Hello all I have a trouble with the simple list and form widgets setup into the portal page designer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 02:21 AM
the simple list shows me the right list of records an when I click on a record the form widget shows me the entire record to be edited good but.
what I need to view is the same that I can see using the open in platform option as default
that shows me the right format of the form I also found that only admin has this option enabled loggin with a standard user it disappear.
Thank in advance
Mauro Dominutti
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2017 01:48 AM
Hi Mauro,
The Service Portal will need any client script to support the mobile scripting environment - so you would just need to set the UI Type to "All" and correct the script for mobile and it will work in both Desktop and Service Portal.
The modules for the navigator is something different. There is no navigator in the Service Portal, but the desktop and mobile UI will use the navigator - so any features for the mobile app will need to be created. Service Portal is supported on desktop and mobile interfaces, as it is built to be responsive.
Your client scripts can work in both Desktop and Service Portal; just update them accordingly. Make sure you don't use synchronous AJAX calls, use callback functions and try to use the APIs (like g_form) rather than DOM manipulation. Sometimes the only thing you need to do is to set the "UI Type" field so it doesn't only run on Desktop.
If you have a client script that is not working on Service Portal, attach a screenshot of the entire client script form so we can check it for Mobile/Service Portal support.
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2017 05:00 AM
ok, I got thewrong way,
Let me try to develop a test app using your suggestions, and check if it works.
only a simple question, the way "simple list widget" in the service portal referring to "form" widget as "link to this page" is right?
Mauro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2017 06:31 AM
Hi Mauro,
The suggestion is to keep the Service Portal and just update the Client Scripts for that table to ensure they function in Service Portal (by making sure they are supporting mobile methodology). A mobile App is not required here.
The Simple List widget does indeed load the page called "form" (id=form) by the "Link to this page" option in the widget instance. You can always create your own page, with your own widget, and reference this instead.
The "form" page is the default as it contains a widget ("Form") that retrieves the form layout for the given view (see the "view" parameter in the URL) for the specified record ID (the "sys_id" parameter) on the given table (the "table" parameter). Client Scripts and UI Policies will apply here - as long as they are supported by the Service Portal.
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2017 07:00 AM
That's what I am going to do,
At this moment I built a specific view that shows me the status of the expenses and it works fine. But also when I used the default view, almost all the OnChange client script work fine the only one do not, it is the OnLoad that do not hide any button. see here after
function onLoad() {
var refs = document.getElementsByTagName("BUTTON");
//Hide all buttons, the submit will be displayed after the confirm yes/no fild is flagged
if (refs) {
for (var i=0; i < refs.length; i++) {
var ref = refs[i];
// ref.style.display = 'none';
}
}
var userName = g_user.userName;
var utente = g_user.firstName + ' ' + g_user.lastName;
g_form.setValue('u_utente',utente);
g_form.setReadonly('u_utente',true);
var dFormat = g_user_date_format;
var tdayDate = formatDate(new Date(),dFormat);
g_form.setValue('u_data_della_richiesta', tdayDate);
g_form.setReadonly('u_data_della_richiesta',true);
g_form.setValue("u_importo_totale.currency", "EUR");
g_form.setDisplay('u_quantita',false);
g_form.setDisplay('u_userid',false);
var myUserObject = g_user.hasRole('u_note_spese_approver');
// the above let me know it the user role is the user's manager;
}
regards
Mauro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2017 07:19 AM
Hi Mauro,
The Service Portal has a completely different DOM to the standard UI, so using code to locate elements are likely to fail in Service Portal.
Also, the Service Portal does not support DOM manipulation - you are using the "document" global variable, which is not allowed:
Supported and unsupported client scripts
Instead, consider that the Service Portal widget is completely different to the standard UI, and that you can manipulate the Submit/Save button in a different way. For example:
How to hide Save button in Service Portal form view
Hide Service Portal 'Submit' button based on Form condition.
Hide submit button on load of catalog item in Service Portal.
You could also consider not hiding the button, but adding an onSubmit rule to return "false" unless a form field has a particular value. This way the user could see a message on submission, explaining what they need to fill in.
Another option is to clone the "form" widget, the remove the "Save" button then create your own button which is only valid when certain criteria are satisfied.
Don't forget that the Client Scripts can be set to only run on Mobile/Service Portal - so they would not apply to the standard Desktop form! That way you can provide specific code for one interface that does not apply to the other.
Mike