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.

How to set a conditional script

Featured Replies

I have two buttons. One that finds all tenants whose rent is past due. And another that does some administrative work and then goes to the layout where a past due letter can be viewed and printed. I need your help with two script issues.

1. Find Late:

If I click on the Find button and there are no records found I get the standard FileMaker dialog box “No records match this set of find request” with the Cancel, Continue and Modify Find buttons that no one ever seems to know what to do with. How do you write a script, when there are no records found, that brings up a custom dialog box that says, “No Tenants found with Late Rent.” And a simple OK button that leaves you at the layout where you called the script.

2. Send Late Notice:

Right now if someone forgets to click the above Find Late button and just clicks the Send Late Notice button. It will set things up to send a late notice to everyone. How can I set up a script that will only run if records are first found by the Find Late button? Maybe even with a dialog box that says, "You must first click the Find Late button"! How cool would that be.

Thanks for your help,

James

1.

Set Error Capture ON

Then, after you Perform Find do this

If[Get(LastError) ≠ 0]

Show Dialog

End If

2. A few things you could do, Since I don't know much about your structure, I'll list a few.

Create a global field, Mark it with something at the begginning of your "Find Late" script, unmark it at the end of the "Send Late" script.

Then, in your send Late Script, you would put:

If(IsEmpty(GlobalField)]

Do your stuff

Else

Show Custom Dialog "You must first click the ...."

End If

Or, if say, You know if they haven't "Found Late" yet, then you're found count will = your total Record count you can do it like this.

If[Get(FoundCount) = Get(TotalRecordCount)]

Show Custom Dialog "You must first click the..."

Else

Do your stuff

End If

  • 2 weeks later...
  • Author

Zero, that was great and works perfectly. Thanks a lot.

James

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.