- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2019 08:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2019 09:32 PM
Hi,
use below approach: ACLs are better approach for these type of requirements.
1) ACL
table.None write and delete ACL; give condition as state is not closed and state is not cancelled;
this will hide the update button when state is closed and cancelled
2) UI Actions
go to ui actions;
1) search with name as Update
2) and select the UI action which is form button
3) open that UI action and change the table from global to change_request and then do insert and stay
4) in the condition field give this; give proper choice value as per your instance
current.state != 'closed' && current.state != 'cancelled'
repeat the above steps for Delete also
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
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
‎06-12-2019 09:05 PM
These should be global UI actions, You will need to take a copy of these UI Action, change its Table to Change Request and append your additional state conditions to its existing conditions.
&& (current.state !=3 && current.state !=4)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2019 11:09 PM
Thank you very much.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2019 09:05 PM
You could remove the Update UI Action by creating a copy specifically for Change, but then any user could still save by the context menu. The real requirement here isn't to remove the buttons but to prevent save & delete on inactive records.
Those are both inactive states, so add an 'active=true' to all your write & delete ACL's on Change Request. That will make the buttons automatically disappear and make the record truly read-only and not deletable.
Learn about ACL's (Access ControL's) here
HOWEVER, You are an admin! so this really isn't a realistic case.
System admins can do pretty much anything and are not representative of a real user
Impersonate a user like 'itil' for a more realistic view.
If you still wanted to apply this to admin, you would need to make sure 'admin override' is unchecked otherwise it will always show. Admins pass all ACL's where this is checked.
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
‎06-12-2019 11:09 PM
Thank you very much.