Manage attachments blocked after status = New

renatasanto
Tera Contributor

I need that in a record in the change table the files attached at creation cannot be removed or replaced after the state = New.
How can I do this?

6 REPLIES 6

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @renatasanto 

 

https://www.servicenow.com/community/itsm-forum/user-should-not-able-to-delete-attachment-in-change-...

 

cc: @Brian Lancaster 

*************************************************************************************************************
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]

****************************************************************************************************************

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

This is a very custom solution but You can create an Delete operation ACL on sys_attachment table.

This attachment should only be for records where table is change_request. And in the script you can query the record and check what the state of the record is, if it is not new then you return false.

-Anurag

renatasanto
Tera Contributor

Thank you for all answers.  
I created a Client Script considering the necessary conditions in my incident. 
Type: onLoad

 

function onLoad() {
    //Type appropriate comment here, and begin script below
    if (g_form.getValue('state') == '-5' && g_form.getValue('u_classification') == 'it') {
        //g_form.addInfoMessage('')
        g_form.disableAttachments();
    }

}

Please close the thread by accepting answer.

*************************************************************************************************************
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]

****************************************************************************************************************