What I do when saving PDF's is use the Offernumber in the filename. A PDF that exists is overwritten.
The filename I create is "OfferNumber" - "ClientName" .pdf.
That way I end up with a bunch of PDF files like this:
001 - John Johnson.pdf
002 - Dave Davids.pdf
I also have a damage part in my database where we make a report that shows the damage. This is a situation that always changes overtime and you want to keep a record of previous damage. So I add the date and the vehicle name to the filename. That way you only overwrite the file on the same day, but the next day, you get a new file. And so you get a whole log of previous pdf files.
Vehicle 01 - 01-01-2013.pdf
Vehicle 01 - 02-01-2013.pdf
If you want to save every single PDF file you could add a timestamp so there is never any file overwritten. But that sounds quite extreme.
I think for your offers using the offernumber as a filename is quite sufficient. You are always left with the most recent version.
Thanks for your reply.
My question was primarly made to know how FM acts in this case.
In fact my aim is to save as pdf a new version of the offer only if some data in the offer_table or in the related offer_lines_table has changed or if it was not saved as PDF after a change has been made and saved.
Thus, I think I'll define some fields (using Get ( RecordModificationCount ) in both tables to have a value in print_version that can be appended to the file name.
Or use the "extreme stamp" made with date and time which is, as I see it now, the quickest way.
Note that save as pdf works a little different in filemaker go.
From the filemaker go development guide :
By default, when you run the Save a Copy As, Save Records as PDF, or Export Field Contents script steps, FileMaker Go creates a new output file. If you continue running the script, a number is added to the end of each filename. For example, the first time you run the Save Records as PDF script step for a sample file, the output filename is sample.pdf. The second time you run the script, the filename will be sample 1.pdf.
To replace the output file with the new one instead of keeping multiple copies, add the file path (file:fileName or filemac:fileName) to the script. For example, if you type file:sample.pdf or filemac:sample.pdf in the Specify Output File dialog each time you run the script, the sample.pdf file in the Documents folder will be replaced with the new one.
The following example saves records as a PDF file named sample.pdf and will either create a new file or overwrite the existing file.
Save Records as PDF [No dialog; "sample.pdf"; Records being browsed]