August 8, 201213 yr Hi guys, I created a layout for my purchasing orders table and added a button which performs a script to save the record as pdf on a filepath, as follows: Set Variable[$PO_pdf; Value:Purchasing Orders::poID&".pdf"] Save Records as PDF[Restore; No dialog;"$PO_pdf";Automatically open; Current Record] I would like to prevent overwriting, since if someone browses the record after the first "save" and accidentally (or on purpose) presses the "save as pdf" button filemaker automatically overwrites the existing file. I've come up with two solutions: 1) Set the pdf name (i.e. variable $PO_pdf) as Value:Purchasing Orders::poID & ".pdf" & {{CurrentDate}} but with this method I'll have two (or more) identical POs with different dates which would be a bit annoying. 2)Set a field named "savestatus" (initial value = 0) and maybe a script triggers OnObjectEnter on "save as pdf" button that changes "savestatus" to 1. Then set conditional formatting on the "save as pdf" for it to vanish on savestatus = 1. Not so brilliant ideas imo Can you suggest something else to prevent overwriting? Thanks a lot!
August 8, 201213 yr I don't understand why overwriting is an issue. If the most recent version of the PO is the one in the database (not a PDF), why would overwriting a previous saved PDF with the most current PO be a problem? Also, what is the purpose of the PO.pdf?
August 20, 201213 yr Author It is required by the company I work for that all documents we create are saved as .pdf and most of them must be printed as well. I know this is quite annoying and not so useful but that's how things are to be done. Maybe you're right about the fact that it's not a big issue if a PO gets overwritten bcooney, I'll try to figure out how to handle the overwriting so that I can keep history of the modifications on POs.
August 20, 201213 yr Before you attempt to export try to import the PDF that might already exist. If you get an error then the file does not exist, so now you can deal with the next step. Of course, if the user has moved the original from the expected place then this will fool matters.
August 20, 201213 yr "History of modifications on POs" -- what do you mean? After they are sent to a vendor? After they are approved by a director, for example? What is the workflow?
Create an account or sign in to comment