0

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.

Versug
  • 33
  • 4

1 Answers1

1

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!

Tanveer Shaikh
  • 1,678
  • 14
  • 27
  • I have a Cross reference in that application if any CR is been selected then in that case this record should not be deleted, like if any dependency is there, so in this case the role would not work. also I need to embed a condition in the custom object that if a field value is yes only then the Delete button should show Alert else it should allow deletion of record. can you tell me how to embed that in JS – Versug Jul 05 '16 at 13:29
  • 1
    @Versug Again, I won't recommend you to use JS here. What you can do is to create a role and give delete access to the users. Create a calculated field which would give you a flag value saying whether the record is associated through a cross-reference. Then, create an automatic RP with rules. In the rules, give delete access to the users depending on the flag value. Hope that helps! – Tanveer Shaikh Jul 28 '16 at 04:18