Skip 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.

YET ANOTHER SCRIPT PROBLEM

Featured Replies

Hello, everyone!!

Ok, I am having yet another script problem, and now that I have written a couple of these, I have a question.

This script is suppose to look at a field that is attached to a value list, and see if a certain box is checked (an item in the value list selected), see if a field is empty, and print a letter to these people. It looks like this:

Go to Record/Request/Page [First]

Loop

If ["(PatternCount(Action List, "Appointment Obtained") > 0) and (IsEmpty(Letters2.2))

Set Field ["Letters2.2","Appt. Thanks""]

Insert Current Date [select, "Letters P Date 2.2"]

Go to Record/Request/Page [Exit after last, Next]

Else

If ["Status(CurrentRecordNumber) = Status(CurrentFoundCount)"]

Exit Loop If [1]

Else

Omit Record

End If

End If

End Loop

Go to Layout ["Pre-Appt Confirmation Letter"]

Page Setup

Enter Preview Mode

Print

Blah, Blah

This script seems to work for the most part, but I have only ONE record in my database that matches the search criteria. When the script is executed, it prints for the record that matches, but also prints for the LAST record in the database. I know this because I changed the sort order around a couple of times, but its always the record that matches and the last record. This last record does not fit the search criteria, and the fields "Letters2.2" and "Letters P Date 2.2" will not be set with the information that would be filled if it had matched the criteria, so I think it is slipping through the loop somehow. But it prints anyways. I think I have something in the wrong place, so if you guys could help, I would much appreciate it.

And now my question: If I put an IF Function in a script, and it looks through the records to find those who match, is it really necessary to have an Omit Record step for the recrods that dont match, or does FM simply ignore those records anyway??

Thats it, thanks for all your guys' help!

Ken

  • Author

Well, nevermind about the script problem, I think I know what I forgot... I need another Omit Record step here:

If ["Status(CurrentRecordNumber) = Status(CurrentFoundCount)"]

Omit Record <---here, right?

Exit Loop If [1]

Else

I tried it, and it seems to work now. But I still have the same question that was posed in the original post

Thanks guys

Ken

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.