You need to sign in to do that
Don't have an account?
Trigger on Attachment/ContentDocument/ContentDocumentLink in Lightning Environment
Hi All,
I have written a trigger on contentdocument object to get the size of the file that is being uploaded. Unfortunately, everytime i upload the document i get size of the file being uploaded as null. Let me know if anybody has faced the same issue and resolved it.
Thanks and Regards
Chidanand G.M.
I have written a trigger on contentdocument object to get the size of the file that is being uploaded. Unfortunately, everytime i upload the document i get size of the file being uploaded as null. Let me know if anybody has faced the same issue and resolved it.
Thanks and Regards
Chidanand G.M.
trigger filesSizeConDoc on ContentDocument (before insert) {
list<ContentDocument> att = new List<ContentDocument>();
for (ContentDocument a : Trigger.new) {
system.debug('=size-content size='+a.ContentSize);
att.add(a);
}
integer sizecheck = att.get(0).ContentSize;
if (sizecheck > 1000){
att.get(0).addError('max size 1 Mb');
}
}