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.

Featured Replies

FM8.5

I have a script that allows me to create a pdf of a record and attach it to an email, as follows:

Go to layout [invoices]

Print setup

Show Custom dialog ["Invoice PDF Option" ; Create PDF of this message (Current) or all Messages (Being Browsed)"]

If [Get (LastMessageChoice ) = 1]

Save Records as PDF [Restore; No dialog; Current record]

Else If [Get (LastMessageChoice ) = 2]

.....

Else If

End If

Send Mail [send via E-Mail Client: Contact::Email: Subject :Invoice

Exit Script

Enter Browse Mode

See attachment for a detailed jpeg.

I want to be able to loop this script to enable me to send an email to a found set. In this case the found set is; Status Order ="shipped" and Status Payment = "" . "" here means status payment has no value - which I might have wrong. Once I have created this pdf email the status changes to "Invoiced".

The caution - I want separate PDFs and not a PDF of all the 'records being browsed' .

Can any one help? Does this require the loop function?

THanks

BuckBuck

I do things like this in 2 steps: first, make it work for the current record -- what you have done. Then create a script that processes the found set. In pseudo code (and omitting lot of error checking):

Go to record [ first ]

Loop

Perform script [ the current record script ]

go to record { next, exit after last ]

End loop

Note that the last go to record [ next ] step has the "exit after last" option selected. This allows the loop to be exited after the last record in the found set is processed. Without this option the loop will be infinite.

If you are not experienced with using loops, always save a backup copy of the file BEFORE running the script because if the loop goes infinite you may have to force quite FMP and this could damage the file.

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.