On 2013-11-13, at 21:41, lassaly <firstname.lastname@example.org> wrote:
On my iOS device I have a form (layout) that I want to send by email. Using a script, I create a pdf then attach to any email.
Try short pauses in your script after Print Setup, after Save Records as PDF and after Send Mail.
Huslik Verlag GmbH - Kopernikusstr. 67, 86179 Augsburg, Germany
CEO Winfried Huslik - HRB Augsburg 12386 - VAT-Id. DE127485099
Phone +49 821 565606, Fax +49 821 565001, Email email@example.com
Verify your FileMaker Pro files with FMDiff - http://fmdiff.com
FileMaker Developer Conference July 28-31 2014 • San Antonio TX
If the issue is there is no pdf attachment occasionally, then I would suggest it is because there is no pdf created. Question for you to investigate: where can the script be initiated from? (I note you have a go to original layout step near the end). It could be that you occasionally have a situation where the requid records are not found when you are on the action layout. I suggest you should perform a find when you get to this layout to ensure you have the required records loaded.
I solved my issue. The file name was based upon a text field that was entered by the users. If the user entered a back slash the PDF would not be attached. You can't have a file name with a back slash. So my script now strips out the back slash and replaces it with a space. Works fine now.
1 of 1 people found this helpful
You should probably use a "whitelist" of acceptable characters rather than a "blacklist". Quotation marks, periods, commas, etc can mess things up, as can spaces on some systems. I use Filter() to pull out any character that's not a letter of the alphabet or a digit.
Thanks for the tip. I'll see how to best apply this.
I agree with David that you should set up your script to eliminate other potential problem characters as well as the backslash—that is just the one you have encountered so far. Note David's comment that even a space can cause issues, so you would be better to replace the backslash with something other than a space, say an underscore. No point replacing one problem with another.