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 05:04 AM
Hi Sona,
You need to select the Run Script in UI type as 'Both' to make it work on the portal. Same applies for catalog clients script as those will also not work if its UI type is not selected as 'Both'.
If this still doesn't solve your query, then please confirm which version of ServiceNow are you working this out on.
Previous discussions about this issue were flagged by many users but it was later fixed from Helsinki Patch 5 and onwards.
Your last resort would be to check with HI Support and report this issue for them to investigate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2017 11:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 04:24 AM
Hi Gaurav,
I have a similar issue. One of my cat.items has a ui policy and that policy does work on the UI but not in the portal. I have set the ui type on both but do not know what script text I should add then.
I have added some screenshots here as well for more explanation. Hopefully helpful in answering my question.
By the way... I'm running on Jakarta.
view in UI
view in portal
Can you guide me in the right directions to make the role field editable in portal as well?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2017 05:26 AM
Hey Sona,
In addition to making sure your scripts are set to run in both mobile and desktop, make sure you are using only mobile compatible APIs.
For example, if you're using client side GlideRecord or some GlideAjax script to get referenced record or location those calls have to be asynchronous and use a callback function in order to work in service portal.
Here's a more comprehensive list of what client side scripting methods are supported for service portal. Check and make sure you're not using any APIs that aren't included in the list: