July 16, 20205 yr 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
July 16, 20205 yr 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
July 16, 20205 yr 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
July 16, 20205 yr 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.
Create an account or sign in to comment