Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NoteOnContentDocument on ContentDocument (before delete) {
- for (ContentDocument c : Trigger.old){
- List<ContentDocumentLink> links = [
- SELECT LinkedEntityId
- FROM ContentDocumentLink
- WHERE ContentDocumentId= :c.Id
- ];
- if (links.size()>0 && Approval.isLocked(links.get(1).LinkedEntityId)){
- c.addError('Approval pending. You do not have the permission to edit/delete this note, please contact your administrator.');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement