2

I'm trying to make a trigger that prevents the user from uploading a file that is larger than 100mb. I'm doing this by checking the file size in the ContentVersion trigger and using addError.

However, when the error appears on the front end, it just contains the default error message, "Can't upload myfile.zip". I can't get it to show a different error message. (I also tried throwing an exception instead of using addError, but the result is the same.)

Does anyone happen to know if it's possible to change the error message in this situation? Or will any error related to file uploading always result in this default error message?

Here is a screenshot of the error message I'm talking about: enter image description here

1

Unfortunately I also couldn't find a way to this by addError or exception message, so I had to write entire thingy custom and include it in the layout, see the idea here and worth voting for it: https://success.salesforce.com/ideaView?id=0873A000000lItzQAE

| improve this answer | |
  • Would you mind briefly describing the solution you ended up going with? For example did you make a Lightning component that listens for a platform event? – Ian Horner Nov 27 '19 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.