How to remove/hide state field choices in change request in list view?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 09:28 AM
Hi All,
I need to hide/remove the state field choices like Assess and Authorize for standard change requests in list view.
can anyone help me with this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 05:25 PM
It may not be possible to hide them, But you can use onCellEdit client script like the one below to prevent updates for these states from list view.
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
if(newValue == -3 || new value == -4){
alert('Not allowed');
saveAndClose = false;
} else {
saveAndClose = true;
}
callback(saveAndClose);
}
To make it prevented only for standard changes you need to create some client Callable Script Include to get the change type and apply the same logic.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2023 05:51 AM
I have tried this approach and have been able to restrict editing the field in the list layout but I need to hide the choices that are not required otherwise the users will be confused.
So I am looking for some alternative solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 07:48 PM
Create a list_edit ACL on the table for the column, here’s a support doc
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0743628
https://www.servicenow.com/community/itsm-forum/how-to-restricting-fields-in-list-view/td-p/721907
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response helped in any way
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2023 05:56 AM
There is an oob list_edit acl on the change table for state field. I have modified that as per my requirement. Along with that, I need to hide the choices for standard change requests.