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.

Exporting using a value from a field

Featured Replies

Hello,

It has been a long while since I posted on this forum. Must have been when was playing with filmmaker 5 or something. But now I have upgraded my filemaker 5 to version 11 advanced and fully busy creating a nice database.

Yesterday I tried to creat a script that would automatically create several PDF files from my database.

To do this I created a field 'pdffilename' and a script with a loop (that starts at the first record and exits the loop after the last record) and in between the script command 'export as PDF'

And in the PDF script I set a file value as '$pdffilename' so it would create a PDF file wih the filename of the contence of the the 'pdffilename' field (which is : file:file01.pdf) the 01 will increase by the number of the record. So record no. 1 is 01 and record 2 is 02 etc.

But somehow it does not work. When I start the script I get aan error message that the PDF file can not be created with a filename like this.

When I change the '$pdffilename' for 'file:file01.pdf' it works fine (well it ovewrites the PDF file a lot of times, but the filename is accepted.)

Any hint why my field entry does not work?

Cheers

Koen

A couple of things that could be the trouble: is the pdffilename field calculating the correct file name? If it uses the Get( RecordNumber ) function then it needs to be unstored. Secondly, as the script runs and saves the pdf files, it is going to the next record so that the file name changes?

  • Author

The filename in the field from 'pdffilename' is 'file:leerling.pdf' This should be a correct filename.

The error message I get can be seen in the attachment.

It seems that FileMaker does not recognize the $ in front of the field name as a field but it thinks the filename is '$pdffilename' itself.

strange isn't it?

Cheers

Koen

Screen shot 2011-06-19 at 8.02.14 PM.png

I set a file value as '$pdffilename' so it would create a PDF file wih the filename of the contence of the the 'pdffilename' field

Not sure what exactly you did here - sounds like you did not define a variable. See if this helps:

http://fmforums.com/forum/topic/45545-looping-script-to-extract-container-jpegs/page__p__212714#entry212714

  • Author

Not sure what exactly you did here - sounds like you did not define a variable. See if this helps:

http://fmforums.com/forum/topic/45545-looping-script-to-extract-container-jpegs/page__p__212714#entry212714

Ah, that did the trick!

I didn't know I it was a variable, thought that this variable was a field in some way.

Thanks a lot!!

Can I use these variable for other things, like a counter?

So if I make a loop in a script and use a variable as counter and exit the loop if the variable reaches 10. (increasing the variable with one each time the loop starts over)?

Cheers

Koen

Can I use these variable for other things, like a counter?

Yes.

  • Author

Yes.

Cool B)

Thanks

Koen

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.