AnsweredAssumed Answered

Problem creating PDF of record/layout, attach to email, send email, loop through remaining

Question asked by straka_sh on Sep 9, 2011
Latest reply on Sep 12, 2011 by philmodjunk

Title

Problem creating PDF of record/layout, attach to email, send email, loop through remaining

Post

I have a database of boy scout groups... the products and quantities each group has sold as well as total $ amounts, etc... I've created a layout that puts it all together, and the boy scout leaders would like a PDF attached to an email sent to each group/unit with their information on it... I'm very close to getting this to work, but the emails I'm creating only have the first record created as the PDF and attached to every email instead of each email having its own PDF of information.

My script:

Sort records [by unit]

Enter Preview Mode

Goto Record/request/page [first]

Loop

       Save Record as PDF [Restore; No dialog; "Email_Report_SNS_Pick_Ticket.pdf"; current record]

      Send Mail [Send via Email Client; To: ***, Subject: ***, Message: ***; Attach file: Email_Report_SNS_Pick_Ticket.pdf"

      Insert Current Date [Select: Email_PDF_Flag] (to show that record has been sent)

       Goto Record/request/page [Next; Exit after last]

End loop

Enter Browse Mode

 

 

 

Pick_Ticket_Email_9_12_11.JPG

Outcomes