Jump to content
Sign in to follow this  
cruijff

Save as Pdf, overwriting issue

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

"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?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Who Viewed the Topic

    1 member has viewed this topic:
    john9210 
×

Important Information

By using this site, you agree to our Terms of Use.