You need to sign in to do that
Don't have an account?
mat_tone_84
limit file size of attachment with a trigger
Hello!
I have to do a trigger which send an email when the attachment's size is > of X kb.
I see that I can't create trigger into sandbox, because there isn't the object "attachment".
first question: Do have I to create the trigger only by eclipse ???
second question: Using the body.size() Will I solve my problem ?
thanks
I create this code, but doesn't work.
If I open an opportunity for upload attachment with size about 2 mb , I haven't any error!
why??
I think that is easy what I'm asking, but it isn't!!
This works properly, before I had inactive trigger.
All Answers
Hi,
To answer your first question, Yes. You need to create the trigger for attachment in Eclipse.
For your second question, You have a parameter "filesize" in attachment.You can use filesize>10000 in the query, where 10000 is 10 MB.
Hope this helps.
Thanks
Hi,
In brief, you can make use of "filesize" tag of "inputFile" VF tag. ie.
I create this code, but doesn't work.
If I open an opportunity for upload attachment with size about 2 mb , I haven't any error!
why??
I think that is easy what I'm asking, but it isn't!!
This works properly, before I had inactive trigger.
Here is the solution,
http://theapexhub.com/restrict-file-count-and-file-size-of-content-document-for-any-salesforce-object/