Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5420 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi everyone!

I am creating a rotation schedule for employees in an 8 hour shift system.

I want to send an individualized PDF of our database as an email attachment to all employees highlighting when and where they have to work. I set up a looping script that saves the individualized PDF to a temp path and then creates an email with the PDF as an attachment. Everything works fine except that some of the time the attachment is missing in one or more emails. The weird thing is, that every time I do the script the attachment is missing in different emails.

Thank you very much in advance for the help.

Cheers,

Sebastian

  • Newbies
Posted

You may want to try pausing the script for a second or two after the Save as PDF step to give the process time to actually save the file.

Posted

Thanks for the advice and sorry for the delayed response. I tried pausing the script but unfortunately that had no effect.

Here is the script in a nutshell:

Loop

Go to Layout ["Dienstplan" (Dienstplan)]

Enter Preview Mode []

Set Variable [$TempPDF; value:Let (prefix = Case ( Abs ( Get ( SystemPlatform )) = 1; 1; "filemac:"; "filewin:"); prefix & Get (TemporaryPath) & "Dienstplan" & ".pdf")]

Save Records as PDF [Restore; No dialog; "$TempPDF"; Records being browsed]

Send Mail [send via E-mail Client; To: field one; Subject: field two; Message: field three; "$TempPDF"]

Enter Browse Mode []

Go to Layout ["Ärzte (Ärzte)]

Go to Record/Request/Page [Next; Exit after last]

End Loop

Posted

I don't think you are stepping through the correct records.

The layout switch to "Artze" is based on a different table so the go to next record step is advancing in the wrong table.

You don't need the preview mode either.

Other than these the script should run fine, but there is still a possibility of a timing issue as you are using the same PDF file name for each loop - so you could end up over writing the PDF before the e-mail application has got going. You would be better off introducing some uniqueness to each PDF - maybe the record ID from the record being produced?

Posted

Thanks for the ideas, but stepping through the records works fine. I forgot a script step that copies a field in layout "Arzte" and includes it in the layout "Dienstplan".

I think your on to something with the timing though, I'll give it a try and let you know.

Posted

IdealData,

I tried a million different things and the only thing that worked was making the PDF-name unique. Now I have a folder with a bunch of PDFs that I have to trash, but at least it works 100%. Thanks for your advice.

This topic is 5420 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.