November 18, 20196 yr Newbies I'm trying to write a script to generate invoices for a group of players by team, save to PDF and eventually email the PDF out. Problem is when I select a particular team, each saved pdf has multiple players' invoices instead of the just one filename = one player. Strange part is the saved pdf for each is different i.e. one file might have 8 different pages (8 different players) while another might have 10. Again, just looking for one filename (dynamic to pull player name) to equal one player, not multiple. Here's the script...Please help! Go to Layout [“Invoice PDFs” (Billing)] Print Setup [Restore; With dialog: Off] Enter Find Mode [Pause: Off] Perform Find [ ] Sort Records [Restore ; With dialog: Off] Loop Set Variable [$Filepath ; Value: Get(DesktopPath) & Player_Person::Player_FullName & “.pdf”] Save Records to PDF [Restore ; With dialog: Off ; “$FilePath” ; Records being browsed] Set Variable [$PlayerIDTEST] Set Variable [$BillingIDTEST] Loop Omit Record Exit Loop If [Player_Person::Player_ID =$PlayerIDTEST and Billing::Billing_ID = $BillingIDTEST] End Loop Exit Loop If [Get(FoundCount)=0] End Loop
November 18, 20196 yr I suspect that the problem is with the 'Records being browsed' option being checked for the Save Records to PDF step. What exactly is a record in the Billing table and how many of them make up an invoice? -- P.S. Please update your profile to reflect your version and OS, so that we know what you can use Edited November 18, 20196 yr by comment
Create an account or sign in to comment