January 10, 200718 yr 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 January 10, 200718 yr by Guest
January 10, 200718 yr Author 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 January 10, 200718 yr by Guest
January 10, 200718 yr Author 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.
January 10, 200718 yr 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
Create an account or sign in to comment