1 of 1 people found this helpful
Are you using a portal on your layout, or a list view?
If you are using a portal you should switch to a list view.
If I have two tables, like Invoices and InvoiceLines, my print script looks something like this:
Go To Layout [ Invoices ]
Perform Find //Invoices I want to print
Go To Record/Request/Page [ First ]
Set Variable [ $id ; Invoices::PrimaryKey ]
Enter Find Mode [ no pause ]
Go To Layout [ InvoiceLinesPrint ] //List view based on invoice lines, and related Invoice::fields in title header
Set Field [ InvoiceLines::ForeignKey ; "==" & $id ]
If [ Get(FoundCount) > 0 ]
Go To Layout [ Invoices ]
Exit Loop If [ Get(RecordNumber) = Get(FoundCount)]
Go To Record/Request/Page [ Next ]
Posting a screen shot of your script would be helpful to trouble shoot this issue.
During step Save as pdf (second appended pages) is there error 9 (Insufficient privileges to modify/access data).
All pdf are saved to the same folder.
Why 30 files from all had problem with saving?
So sorry, I have CZ version of FM.
This error message means that the filemaker account running the operation does not have write access to the place where you are trying to save.
If something opens the PDF during the script running I think the append option will error if you try to append to an open file. Not sure if this your problem but it might be something to check.
You mentioned that the one-pages invoices are different.
In what way are the one-pages invoices different (except for the one page)?
FM save all 600 files to this one folder, but only some of them have problems.
Nobody ( only FM server) has access to this folder.
All files are the same (only content of these invoices are different). But only some of them have problem during adding second page to early created first page.
Is there a pattern to when the bad invoices PDF? If you pdf the invoices in groups of 200 instead of one big group of 600, does the problem persist.
I tried to generate 100 PDF files and 6 of them was has¨t created second page.
I tried it second time and there was problem with 5 another files (previous 6 files was created correctly now).
Is it possible that some invoices are saving as PDF with a script step that has a "records being browsed" option, while others are failing because the option setting is "current record?"
Hmmm, saving a PDF is asynchronous. The PDF is still being generated even as the next step of the script executes. Thus I wonder if the system is trying to append page 2 before page 1 has been fully generated and saved to disk In a few cases.
If so, pausing the script for a few seconds to allow the save of page one to complete consistently may be needed.