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.

Auto Adding Info to a record being saved as a pdf.

Featured Replies

  • Newbies

Hello all,

I have a button setup to print as a pdf. What I want to do is: When that button is pressed, the save dialogue box will already have the serial number and date added to the filename from the serial number and date field for that particular record..

Any ideas how this can be achieved?

Will it require a script?

Thank-you in advance for your help.

Kind Regards.

Andy

What you would do is create a script.

Start by setting a variable $path to:

Get(DesktopPath) & Table::SerialNumber & "_" &  Table::YYYYMMDD & ".pdf"

YYYYMMDD is a field that calculates a date in to the above format - you will need to sanitize your file name to avoid illegal characters. (no slashes) 

then you perform step Save Records as PDF passing in the variable $path adjust any additional settings for the script step (Recommend you use create Folders on" this way if you want to create a folder you can just add it to the path in front of the serial number.

You will find a PDF on your desktop

  • Author
  • Newbies

Hiya Ocean,

Thanks ever so for the reply. I've just realised.... based on your info, this looks a lot more complicated than I initially thought. I was thinking I could just write a line using the actual field info on my database in a script:

Get C:\Users\andrew.palmer\Desktop & Table: :Serial1 & "_" &  Table: :Date & ".pdf"

Where Serial1 is one field and Date is the other field in my database.

 

I may have to ask around for a step by step guide.

I was only ever used to FMpro 9 and no scripting. Ha ha.

 

Thanks & Kind Regards

Use this:

Get(DesktopPath) & Table::Serial1 & "_" & Substitute ( Table::Date ; "/" ; "_" ) & ".pdf

The Function Get(DesktopPath) will resolve the path for you. I wrapped the date in a substitute to convert slashes to underscores.

  • Author
  • Newbies

Hiya Ocean,

WONDERFUL!

Thanks EVER So !

Kind Regards.

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.