Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Selecting first blank Container repetition

Featured Replies

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

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

  • Author

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

Which script step do you use to insert a .pdf into a container ?

Use it.

  • Author

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

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...
  • Author

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.