cruijff Posted August 8, 2012 Posted August 8, 2012 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!
bcooney Posted August 8, 2012 Posted August 8, 2012 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?
cruijff Posted August 20, 2012 Author Posted August 20, 2012 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.
IdealData Posted August 20, 2012 Posted August 20, 2012 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.
bcooney Posted August 20, 2012 Posted August 20, 2012 "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?
Recommended Posts
This topic is 4546 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now