Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I have a layout that creates an invoice. I wish to save a copy of the invoice as a pdf into a repeating container field. Although Filemaker provides the "Last(field)", this returns the last non-blank repetition, whereas I require the first blank repetition. At my wits end over this one. Any guidance would be most appreciated.

Eric

Posted

Hi

try this script:

Set Variable [ $rep ; Value: 1 ]

Loop

If [ not IsEmpty ( repeatingField[$rep] ) ]

Set Variable [ $rep ; Value: $rep + 1 ]

Exit Loop If [ $rep > GetAsNumber ( FieldRepetitions ( Get ( FileName ) ; Get ( LayoutName ) ; "repeatingField" ) ) ]

Else

Save Records as PDF [ Restore; No dialog; "a.pdf"; Current record ]

Go to Field [ repeatingField[$rep] ]

Insert Object [ "a.pdf" ]

Commit Records/Requests [ ]

Exit Script [ ]

End If

End Loop

Posted

Hi Raybaudi

Thanks for the script. I was some distance from figuring it out myself. I'm unsure about the "Insert Object" line as I am on the Mac platform, and I believe it's for Windows. Any ideas for alternatives please?

Eric

Posted

Hi

The "Insert File" step worked a treat. I had tested it on a local database and it was successful. Whenever I use the script on a remote database, it doesn't automatically find the a.pdf to insert it into the container, forcing me to manually locate it. Do you think it's something I have to live with?

Eric

Posted

a.pdf was only an example !

At the top of the script, set a variabile ( $path ) with the exact path and name of the file you want.

After that, you have to substitute "a.pdf" with $path in the remaining script steps.

BTW: I don't think that it is a good idea to store those PDF into a file of FileMaker, neither to store them into a repeating field. For me it is better to store only a reference to the pdf ( each named dinamically by the $path ) into a normal container field of the Invoice table.

  • 2 weeks later...
Posted (edited)

Hi again raybaudi

Meant to thank you earlier for your suggestion. It worked. The reason why I had opted for a repeating container file was for neatness. I also wish to store delivery notes printed and I thought it was a good idea to retain them as a reference to the original file that should be held on the server. Anyway, thanks again from Scotland.

Edited by Guest

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