Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted (edited)

I am trying to write a script that saves a report as a PDF..."Save Records As PDF(Restore; No Dialogue; $wip report; Records being browsed )"

I am using a variable ($wip report ) in the "specify output file" as seen above. When I execute the script I get a message that the file "$wip report" cannot be create on this disk blah blah bla.

It looks to me that the "Save Records As PDF" is trying to save the file with the variable name and not its contents. Is this the way it is supposed to work?

Edited by Guest
Posted (edited)

I set $wip report = "File:/N:/FileMaker/WIPnAR Reports/Reports/WIP" & Mbillaty::tkinit & ".pdf"

using the set variable function.

Mbillaty::tkinit = "01070" so the result is "File:/N:/BileMaker/WIPnAR Reports/Reports/WIP01070.pdf" By the way if I paste the contents of the set variable into the save records as function it works fine.

Edited by Guest
Posted

I just found out that it works if the variable is global that is $$wip. The script that creates the pdf is a subscript to the script that assigns the filepath. I did not believe this was necessary if it all ran at one time.

Posted

From the FM Help regarding variables:

A local variable can only be used in script steps in the currently executing script. The value in a local variable is cleared when the script exits

Here is something other threads that you may want to check out as well.

Local vs. Global

Scope of Global Variables

This topic is 6528 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.