You need to sign in to do that
Don't have an account?
Amidou Cisse
Hello everybody, Some baby could help me to test this trigger and class
//BlockContentLinkTrigger trigger BlockContentLinkTrigger on ContentDocumentLink (before insert) { for(ContentDocumentLink contDocL : Trigger.new) { if (CDLHelper.isSharingAllowed(contDocL)) { contDocL.addError('Pièce joint bloquée depuis objet ContentDocumentLink'); } } } //CDLHelper public class CDLHelper { public static boolean isSharingAllowed(ContentDocumentLink cdl) { //String docId = cdl.ContentDocumentId; ContentVersion version = [select PublishStatus, FileExtension from ContentVersion where ContentDocumentId =: cdl.ContentDocumentId limit 5]; if (version.PublishStatus.equals('P') && (version.FileExtension != 'null')) { return false; } return true; } }
Use below Test class
Hope this will help you.
Thanks
karthik
All Answers
Use below Test class
Hope this will help you.
Thanks
karthik