- 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 @sattar3
Is there any business reason to hide one state? “Closed – Skipped” is just as important as other states. It may not be needed for some catalog items or tasks, but in certain cases, using “Closed – Skipped” is a good option instead of marking them as “Closed – Complete.”
From a process perspective, it’s better to keep the OOTB state and guide users on its purpose rather than removing the skip state and creating technical debt.
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 @sattar3 ,
Why hiding instead of deactivating
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
