AnsweredAssumed Answered

payroll, email, and pdfs...

Question asked by jrobgk1 on Apr 14, 2011
Latest reply on Apr 29, 2011 by philmodjunk


payroll, email, and pdfs...



I have a payroll report that I need to run every two weeks, based on a table Models::Events Scheduled.  When i sort the layout, i get the model's information (hours worked, etc) pay rate, and date worked.  There is a trailing summary that calculates the total $ owed to that model.  

When i preview the page, i can cycle through and see each model's pay stub, and that works fine.

However, i want to automate sending an email pdf of the paystub to the model.  I have created the script that builds the temporary pdf, and emails that temp pdf to the model in question.

I am calling a script called mailpayroll that is as follows:


Constrain Found Set
Perform Script "Email Form"

End Loop
Go to Record/Request (next), exit after last

The Email Form script is:

Set variable [$temppdf; value:Get (TemporaryPath) & "info" & ".pdf"]
  Save Records as PDF [Restore; $temppdf; records being browsed]
Send Mail [via client]; To: List (model scheduled::email); Subject: "blah"; "$temppdf"]
End Loop 

The behavior i am getting always starts at the first model, but doesn't progress from model 1 to 2. 

I want to have the script step through all the models that would have paystubs for a given period automatically. 

What am I missing?

Thanks in advance...