How can I prevent Filemaker from crashing when running a script (Send Invoice By Email) ?
I'm sending an invoice by email. I save the record as PDF and then I send the invoice via an email client. The script runs fine the first time I click the button but the second time around filemaker crashes. I tried to send the email via Outlook and Moxilla ThunderBird but the second time around FileMaker always crashes. This is the script.
Send Invoice by Email
Set Error Capture [ On ]
If [ Get ( LastError ) = 0 ]
Set Variable [ $PATH; Value:Get ( TemporaryPath ) & "Invoice " & Invoice::InvoiceID & ".pdf" ]
Go to Related Record [ Show only related records; From table: “ItemLine” ; Using layout: “Print/Send Invoice” (ItemLine) ; New window ]
Save Records as PDF [ Restore; No dialog; “$PATH”; Records being browsed ]
Send Mail [ Send via E-mail Client ; To: Client::EMail; Subject: "Invoice # " & Invoice::InvoiceID & " | " & CompanyInfo:: CompanyName; Attachment: “$PATH” ]
Close Window [ Current Window ]
Help to troubleshoot this issue is appreciated.
Newbie to FileMaker
FileMaker 12 Pro Advanced
Window 7 64 bit