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

Anurag Tripathi
Giga 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.

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.