how to use client script and ui policy on service portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2017 04:23 AM
I have catalog item named asset relocation
this catalog item is used to relocate the asset from one location to other. in this cat item when u select any item it will automatically populates its current location in current location field. for this I hv used reference variable "curr_location" and ui policy to find the location from location table
I want this to work in service portal. but in service portal it is not auto populating the current location of item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2017 11:24 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2017 11:28 AM
Hey Sona,
It looks like the problem is the getXMLWait().
In service portal you have to use asynchronous ajax.
Try moving the code to set the value into a function and then call ga.getXML(yourFunction())
Check out this example from the developer docs for the exact syntax: AJAX but it would be something like this:
.. your glideAjax code..
ga.getXML(callback);
function callback(response){
g_form.setValue("curr_location",answer);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2017 11:45 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2017 11:49 AM
Ah, sorry, I mixed up the variable name. g_form.setValue("curr_location",answer); should have been g_form.setValue("curr_location",response);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2017 09:06 PM
Thanks Jesse.
All these codes are working properly in service catalog (native).
But it is not working in Service portal.
Is it related to the concept that client script and UI policy does not apply in service portal?