Grayed List choice "Delete" UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 04:18 AM
Hi All
I have query, When the change request state is move to approval, need to gray out the “Delete” list choice for affected CIs in the related list.
“Delete” is List choice global UI action, and it is working on change_task in the related list but not on the affected CIs.
Thanks & Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 04:27 AM
Hi @madhusagar
For this you need to change the OOTB UI action on delete and add the condition.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
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/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 04:38 AM
Hi , Thanks for quick response. But already condition is added as current.canDelete for the OOB UI action. Same is working for change_task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 04:53 AM
Hi @madhusagar
you need to add on state and table as well.
https://www.servicenow.com/community/developer-forum/hide-ui-action-by-role-and-state/m-p/2589305
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
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/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 04:56 AM
Hi @madhusagar ,
This is not OOB behavior which you were talking about for change task, there must be delete acl would be written for that. You can also write delete acl on task_ci table to disable the ui action. Create delete acl on task_ci and use below script in your acl .
if (current.task.sys_class_name == 'change_request') {
var changeState = current.task.state; // Get the state of the Change Request
// Check if the state is "Approval" (replace with the appropriate value for "Approval" if needed)
if (changeState == '3') { // Assuming "3" is the value for "Approval"
return false;
}
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------