You need to sign in to do that
Don't have an account?
Apex developer 21
List index out of bounds: 1 Trigger.NoteOnContentDocument: line 9, column 1: []
I have this following class that i want to deploy but i keep getting this error: List index out of bounds: 1 Trigger.NoteOnContentDocument: line 9, column 1: []
Could anyno help please with my code:
Could anyno help please with my code:
trigger NoteOnContentDocument on ContentDocument (before delete) { for (ContentDocument c : Trigger.old){ List<ContentDocumentLink> links = [ SELECT LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentId= :c.Id ]; if(!links.isEmpty()){ if (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.'); } } } }
All Answers