- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 01:39 PM
Hi Team!
I am working in the Agent Workspace area and am trying to recreate a UI scrip that functions in our ServiceNow UI however, in Agent Workspace, there seems to be some difficulty and thats why I am reaching out.
On the incident table, if an Agent selects a Business Service (business_service) of Software, I need to show the software selction box (u_software) and make it mandatory.
I have this in a Client Script, sitting in the Agent Workspace application, Incident table, UI Type: All, Type: onLoad, and have Isolate script checked.
My current code:
function onLoad() {
if(g_form.getDisplayBox('business_service').value == 'Software') {
g_form.setDisplay('u_software',true);
g_form.setMandatory('u_software',true);
}
else {
g_form.setDisplay('u_software',false);
g_form.setMandatory('u_software',false);
}
}
I cannot get this to work. Perhaps someone out there can assist?
Thanks;
Dave
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 03:00 PM
If you just remove the "if" that is checking isLoading you probably can skip the onLoad script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2022 06:34 AM
Not possible but as I think about it that maybe a good suggestion to put on the idea portal. A way to say that these n+1 posts gave me the full answer to my issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 02:51 PM
Have you tried just using a UI Policy for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 02:58 PM
Does a UI policy work the same in the Workspace environment?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 03:00 PM
As far as I am aware they do.