Prevent users from updating status to resolved, closed , on hold from list view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 03:06 AM
By using the Client Script on need to get out put ? and the table is incident
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 03:12 AM
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 03:36 AM
Hi,
I agree with Paul here.
list_edit ACL is the best approach but remember users won't be able to edit anything in that field if ACL evaluates to false.
If you want users to change the status from list view but restrict which one to update then use before update BR
Condition: Status [IS ONE OF] Resolved OR Closed OR On Hold
Script:
gs.addErrorMessage('You are not allowed to change the status');
current.setAbortAction(true);
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-29-2020 03:39 AM
Also have a look at the OOB List Edit ACL on Incident table and replicate for your requirement accordingly.
https://YOURSERVICENOW.service-now.com/nav_to.do?uri=%2Fsys_security_acl.do%3Fsys_id%3Dfb90a1e9a6811596009e5055b5156bcd%26sysparm_record_target%3Dsys_security_acl%26sysparm_record_row%3D1%26sysparm_record_rows%3D1%26sysparm_record_list%3Doperation.nameCONTAINSlist%5EnameCONTAINSinci%5EORDERBYname
Thanks,
Saji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 03:41 AM
Hi,
if you want client script then you need to use onCellEdit client script on incident table with that field
Note: Use proper choice values
Example:
6 - Resolved
7 - Closed
9 - On Hold
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
if(newValue == '6' || newValue == '7' || newValue == '9'){
alert('Not allowed');
saveAndClose = false;
} else {
saveAndClose = true;
}
callback(saveAndClose);
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader