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 do I write an "If" statement?

Featured Replies

I currently have a script:

Go To Layout [Multi Promotions]

Enter Find Mode

Go to Field [ProductDiscount]

Insert Text [ProductDiscount]

hi,

Take a look at using the Show Message Script Step using the If statement with a calculation = Status(CurrentMessage)= 1 and =2, etc.

This tip file might help you also.

Status (CurrentModifierKeys) Layoutmode.com http://www.layoutmode.com/fmprofunctions.html

HTH

Lee

wink.gif

  • Author

Hi Lee and thanks for the reply,

I'm new to FileMaker and am sorry to say "I don't have a clue" of what you just told me to do.

If you could elaborate a little more I would appreciate it very much.

Thank you,

Hi,

Lee's answer is the simplest way, and I'm sure he will expand on this feature.

I 'll tend to use another method using container fields and relationships as finds can take a long time. Hope this doesn't drives you to another confusing status...

Open the invoice file and select a product ID...

Hi:

you can do this a couple of ways:

If[status(CurrentFoundCount) = 0]

Show Message []

-or-

If[status(CurrentError) = 401]

Show message

Ken

Give this script a try. It requires that you set up the find manually so that it is stored in the script.

Set Error Capture [ On ]

Go to Layout [ Multi Promotions ]

Perform Find [ Restore ]

If [ Status( CurrentFoundCount) > 0 ]

Exit Script

Else

Show Message [ "There are no promotions at this time" ]

If [ Status( CurrentMessageChoice) = 1 ]

Go to Layout [ Data Entry ]

Show All Records

End If

End If

Go To Layout [Multi Promotions]

Enter Find Mode

Insert Text [ProductDiscount, ">0"]

####### note the next step ######

Set Error Capture [ON]

PerformFind [Replace Found Set]

If[status(CurrentFoundCount) > 1]

.. Go To Layout

Else

.. Go To Layout [Data Entry

..If[status(CurrentFoundCount) = 0]

....Show Message [There are no promotions at this time]

....Show All Records

..End If

End If

The tweak here is that when there's only one record found, you go to Data Entry, if there's more than one, you go to your List layout.

How come editing my post puts in extra carriage returns? I've tried to change it with soft returns etc... I give up.

  • Author

I want to thank all of you for your help. The script is working great! I didn't know there were so many ways of doing the same thing with scripts.

Thanks again,

Bigzilla

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.