- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2016 10:10 AM
Hi everyone,
I am trying to set a value to a catalog item variable via Catalog Client Scripts. It is working if being loaded in native UI but when opening in Service Portal the value is not being set. I'm really baffled at this. Anyone know why? Thanks - Regina
Here's the code (onLoad):
g_form.setValue('variables.url', 'test');
Native UI:
Service Portal:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2016 11:35 AM
Hmm...could you post your entire client script? Also, make sure you have UI Type marked as Both on the catalog client script record itself.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2016 11:35 AM
Hmm...could you post your entire client script? Also, make sure you have UI Type marked as Both on the catalog client script record itself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2016 01:41 PM
Is the Service Portal widget rendering the Catalog Item considered "Mobile"?
What is a good method to detect a client script is being evaluated in the Service Portal?
So far, I have been using if(window === null).
Thanks,
John G
Using documentation/client_scripting.md at master · service-portal/documentation · GitHub as reference doc.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2016 02:51 PM
Hi John,
That should work. It's not necessarily considered mobile as much as they have similar APIs available. window is blocked in Service Portal so it's a good way to check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2016 03:25 PM
Hi Brad,
Ok, cool. I wanted to make sure there was not some special method/object similar to g_service_catalog available to determine Service Portal evaluation.
Thanks!
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2016 01:52 AM
Hi Brad, removing the "variables" from the setvalue AND setting the UI Type to "Both" did the trick. Thank you so much!