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

  • Newbies

I can't seem to get the if statement to work for the Status (CurrentMessageChoice). I have created a message with the two responses OK and Cancel. I am using the following if statment:

If ("Status(CurrentMessageChoice = "1")") I have also tried If ("Status(CurrentMessageChoice = "true")") I can't seem if satisfy the IF statement. Help.

Hello Karen,

be sure you are testing the right button: they are numbering starting from the rightmost (1) to leftmost(2, in your situation).

Greetings.

Try: IF (Status(CurrentMessageChoice)= 1)

Right, you don't need the quotes around the "1". Also remember how status tests work. You can only perform a valid status test in the next script step. For example:

Show Message ()

If (Status(CurrentMessageChoice) = 1)

If you test later, for example:

Show Message()

If (Status(CurrentMessageChoice) = 1)

Perform Script()

End If

If (Status(CurrentMessageChoice) = 2) <--- INCORRECT

Perform Script()

Is not a valid way to perform a test. The results of the "Show Message" script step stored as a status can be altered by status results of following script steps. The dangerous part of this is that sometimes you can get away with it, only to have it fail in another script with a step that sets status. This can create problems that are hard to find. The proper way to test message choices if you need more than one test is to store the status result of the "Show Message" step in a global number field (call it gStatus). For example:

Show Message()

Set Field (gStatus, Status(CurrentMessageChoice))

If (gStatus = 1)

Perform Script()

End If

If (gStatus = 2) <--- CORRECT

Perform Script()

-bd

Boy am I glad I checked here - I have loads of scripts with incorrect Show Message status scripts all testing the status sequentially, but somehow I've never been caught out.

Live Oak, can you please give an example of a "script with a step that sets status" and how it would cause a problem? I'm not sure what to specifically avoid.

Thanks!

Pretty much any action script step that can fail generates a status. Delete record might fail if you don't have proper privileges, for example. This best idea is to write scripts to avoid the problem. If is too easy to add a script step without reviewing to see if status is generated. It's kind of like asking which roads are not used very often so you can drive on the wrong side! Take a look at the status codes and this will give you some idea of the variety of possibilities.

-bd

Worth knowing. Thanks very much!

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.