title: SuiteFlow||SuiteScript: Send email based on file size
body: <p>We have a Suiteflow that sends an email as an attachment. However, the email doesn't send if the attachment is over 5 MB in size. I want to add a condition to the action that says when document size is &lt; 5 MB. I planned on then adding a separate action to send the email without the attachment if the file size is >= 5 MB. Is this possible and if not, what work around is there? </p>
  
  <p>SuiteScript (Javascript) is certainly an option but I would prefer just modifying the existing SuiteFlow</p>
  
  <p>::In Response to below comments:
  The email attachment is added to a Document field on the Transaction, not in the File subtab. I cannot find how to get at it's properties (like size) therefore in a search. (idea #2 below). 
  Also, the code sample (idea #1) does not work because nlapiLoadFile will not load a file > 5 mb, meaning I can't do a test etc. I am trying to avoid writing the whole thing as a script. </p>
  
  <p>So far the only solution (and I don't feel it is a good one) is to take the sending of the email, make it into a script, and do a try catch on it. Any other ideas??</p>