How to hide Update and Delete button on Change Request when State is Closed or Canceled?

Akkapolk
Giga Expert
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thank you very much.

Sanjay Bagri1
Tera Guru

Hi

You can write the &&current.state!=3 in both button condition fields when you will edit these two buttons based on the conditions

like this in both button :

find_real_file.png

Thanks

Sanjay Bagri

Thank you very much.