javascriptrsacustom-objectarcher

How can I abort deletion of record on click of delete button?


I am working on Archer. in my application a user opens a record and when user clicks on delete button to delete the record at that stage I need a custom object which gives an alert on clicking delete button and does not allows the user to delete the record.


Solution

  • I would strongly recommend you to not use custom object to prevent deletion of records.

    Archer provides us with a better, more sophisticated method of using access roles and record permission fields for that.

    You can create an access role for all the users that you want to give Read and Edit rights and not give them Delete content rights through the role.

    However, if the custom object is absolutely necessary:

    $(document).ready(function () 
    {
        $('#master_btnDelete').removeAttr("onclick");  
    
        $('#master_btnDelete').click(function (){  
            var alertMsg = '<your message goes here>';
            alert(alertMsg);
        }); 
    }
    

    Hope this helps!