Grayed List choice "Delete" UI action

madhusagar
Tera Contributor

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.

madhusagar_0-1735820264539.png

Thanks & Regards,

 

7 REPLIES 7

Hi Runjay,

 

Thanks for your response, but I tried with your script PDI also by changing the state value as below.

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"
           
            answer = true;
        }
    }
 
if i use return inside the loop it is giving syntax error.
Please help me.

Hi @madhusagar ,

what you done is correct it should not be returned it should be set to answer variable.
you have to adjust all the other ACLs with the same script which are giving the access to delete the  records.  
For testing use the non admin user if any ACL is with admin overrides checked.



Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

Hi Chaitanya,

 

Thanks for your response,

When I impersonate with non admin I observed that "Delete" button still visible but "Delete with Preview" is button is grayed out. Please let me know , I want to grayed out both.