- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Everybody,
I need to hide the “Closed Skipped” state choice on the RITM form.
- Will hiding it at the form level affect historical records that already have this state?
- I tried a UI Policy with
g_form.removeOption('state', 7);. It hides the option, but when I open historical records, the form shows Pending while the list view still shows Closed Skipped.
Any recommendations on the right approach?
For more details please refer the attached screenshot.
Thanks,
Sattar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
Add a condition to your UI policy so it only runs if the state is not already Closed Skipped, that way you're only removing the option on records in another state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Like this:
For this example, we will ensure that a user does not enter a high impact into a cell to force them to open up the form view to do this:
function onCellEdit(sysIDs, table, oldValues, newValue, callback) { var saveAndClose = true; if (newValue == 1) { alert('High Impact cannot be set on a list view.'); saveAndClose = false; } callback(saveAndClose); }
This example uses the newValue parameter to check the value the impact has been set to. If it has high or 1 as the value of the field, which we need to use in scripts rather than labels, then the user is alerted through a message. By setting the saveAndClose variable to false, we can also stop the field from being updated. This is because the callback is using this variable, and therefore also sets the callback to false.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
Add a condition to your UI policy so it only runs if the state is not already Closed Skipped, that way you're only removing the option on records in another state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thanks @Kieran Anson It worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Glad that worked, feel free to mark my answer as accepted to close the question.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Kieran Anson , is there other way to hide that choice from the list view, In form level its working but in list view we an able to see the Closed Skipped Option?
Thanks,
Sattar
