- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2020 07:07 AM
How to hide a Related Tab and sections from the RITM form using a UI Policy script.
when a particular catalog item is used, the the RITM generated should hide few of the fields, sections and related list and tabs on the form.
I have written the code like below in UI Policy Run script
function onCondition() {
g_form.setDisplay('request', false);
g_form.setDisplay('location', false);
g_form.setDisplay('cmdb_ci', false);
g_form.setDisplay('priority', false);
g_form.setDisplay('u_ritm_category', false);
g_form.hideRelatedList('u_vendor_id_reference', true);
//g_form.setDisplay('u_vendor_id_reference', false);
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2020 08:01 AM
the correct syntax to hide/show section and related list is below
g_form.setSectionDisplay('schedule', false); // name of section
g_form.showRelatedList('task_ci'); // name of related list
g_form.hideRelatedList('task_ci'); // name of related list
check below links for help
Show/Hide Form Section by Name
Hiding Related Lists and Embedded Lists
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2020 10:26 PM
Hi,
I doubt you can hide the embedded list of Vendor IR References
But the related list should be possible
Is this setup in your PDI and you are ok to share url and some admin credentials please share here
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2020 12:35 AM
I have set this in my PDI, below is the URL:
https://dev68200.service-now.com/
id: test.123
pwd: 12345
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2020 01:42 AM
I just checked and it is able to hide Affected CI, Approvals, Incidents, Task SLAs
I was about to check for other but now could not login to instance
just debug line by line by commenting the g_form.hideRelatedList()
also error here
g_from.hideReleatedList('sc_req_item');
it should be g_form and not g_from
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2020 01:49 AM
Can you login now and try.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2020 02:02 AM
No success.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader