- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2022 10:10 AM
Hi - I created a Client Script based on ServiceNow Guru to hide the Demand form's Assessment Data tab. However, when I go to an existing demand, I see the assessment data tab for a micro-second before it disappears. Is this really the best way to hide it? I don't want people calling me about a tab that 'went away'.... Thanks!
Client Script on Demand [dmn_demand] table; Type = onLoad
function onLoad() {
//Hide assessment data section
g_form.setSectionDisplay('assessment_data', false);
}
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2022 06:31 PM
Hello,
Clients scripts execute first before UI policies.
But if you have other client scripts which are taking longer timer to load, then during that time the tab will be visible.
If you want to reduce the time it displays before an user can action on tab, then you can order the client scripts using the Order field and make sure that your script executes first. [Order field is present in client scripts but you need to configure it in form or use it in list view if you really need it]
If I remember correct, client scripts without any order value will execute first, if there are multiple client scripts without order value, then the order is decided by system on how they are loading in browser.
Even with all of these, if the internet connectivity of the end users are slow, then there is still a chance that tab will appear while the form is rendering.
The reason is, until the system renders all fields it will not apply any scripts or policies.
If you do not want the fields to be visible, you may have to write ACL's as per your business need and make sure you restrict them at the server side if that is possible.
Unfortunately it is not feasible to do it in this manner all the time.
There are some tradeoffs we may need to live with in some cases.
Hope this helps!
Thanks and regards,
Subrahmanyam Satti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2022 10:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2022 10:45 AM
I'm already using Client Script which still displays the tab for a nano-second before hiding. I want it to not even display for the nano-second.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2022 04:58 PM
Sometimes that delay is visible.
You can try a scripted UI policy. It may be able to remove the delay as UI policies are executed before client scripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2022 06:31 PM
Hello,
Clients scripts execute first before UI policies.
But if you have other client scripts which are taking longer timer to load, then during that time the tab will be visible.
If you want to reduce the time it displays before an user can action on tab, then you can order the client scripts using the Order field and make sure that your script executes first. [Order field is present in client scripts but you need to configure it in form or use it in list view if you really need it]
If I remember correct, client scripts without any order value will execute first, if there are multiple client scripts without order value, then the order is decided by system on how they are loading in browser.
Even with all of these, if the internet connectivity of the end users are slow, then there is still a chance that tab will appear while the form is rendering.
The reason is, until the system renders all fields it will not apply any scripts or policies.
If you do not want the fields to be visible, you may have to write ACL's as per your business need and make sure you restrict them at the server side if that is possible.
Unfortunately it is not feasible to do it in this manner all the time.
There are some tradeoffs we may need to live with in some cases.
Hope this helps!
Thanks and regards,
Subrahmanyam Satti