The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Unable to hide/show fields on Agent Workspace

Dinesh Gajje
Tera Contributor

Hello Experts

I'm facing an issue with an UI Policy (with Run Script enabled) which is supposed to Show/Hide fields and Form Annotations on Workspace. It works perfectly on Platform UI, but it does not work as expected on the workspace. Below is the code snippet used in the script section.

find_real_file.png

I read some posts which says some of the `g_form` API's are not supported on the Workspace, but not seen any ServiceNow KB article which confirms it. 

 

Application: Custom/Scoped Application (Created 'glide.script.block.client.globals' property with respect to scope and set had set the value to 'false').

Version:Orlando Patch 4

Module: CSM Agent Workspace.

I would appreciate any insights on the issue and for any alternate solutions.

Thank you

Dinesh

1 ACCEPTED SOLUTION

Willem
Giga Sage
Giga Sage

Not sure the $('ap').up().show() and $('ap').up().hide() is supported. Did you try checking the browser console for errors?

You can press ctrl + shift + i and click on console:

find_real_file.png

If there are any errors after running the script, that might help us further.

 

Also I do not see setDisplay in the supported API's:

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/build/service-portal/reference/c...

 

Maybe you can change it to:

setVisible(fieldName, isVisible)

View solution in original post

8 REPLIES 8

Can you try this:

SN.formAnnotations.preference = false;

SN.formAnnotations.infoPreference = false; 

 

https://community.servicenow.com/community?id=community_question&sys_id=7aa18b69db98dbc01dcaf3231f96...

Thank you, I checked this post earlier. But it does not helped me to crack the issue on the workspace view.

I see many of the scripts for hiding annotations works perfectly on Platform UI, but does not support the Mobile/Workspace behavior. 

Dinesh

I am afraid so.

What do you want to do with this question? I think it would be good to share what we have and create a separate question that focuses on hiding/showing annunciations on Agent Workspace.

Let me know what you think.

Also, can you kindly mark my answers as helpful👍

Sure thing, will do. I really appreciate for your help here.!!