Jump to content

Save as Pdf, overwriting issue


cruijff

This topic is 4261 days old. Please don't post here. Open a new topic instead.

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!

Link to comment
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?

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
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.

Link to comment
Share on other sites

This topic is 4261 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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