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.

Checkbox value via script issue

Featured Replies

Hi!

Hope that someone can shed some light on the following issue:

I have two checkboxes from the same table. First one is a text field with Auto-enter calculation which says if Checkbox 2 contains certain value, Checkbox 1 should be empty/unchecked: Case ( Checkbox 2= " EXPELLED"; ""). It works fine.

However if I decide to override Auto-enter calculation, meaning having both Checkboxes checked and then uncheck Checkbox 2 making it empty, Checkbox 1 gets also unchecked although Checkbox 2  in fact does not contain value "Expelled" defined in the calculation.

What am I missing?

Any help is appreciated!

I think you want to do something like:

 Case ( Checkbox 2 = "EXPELLED" ; "" ; Self )

or perhaps more simply:

 Case ( Checkbox 2 ≠ "EXPELLED" ; Self )

However, this assumes that the Checkbox 2 field can either contain the text "EXPELLED" or be empty. Usually, a checkbox field can contain several values, and if you want to test for the presence of "EXPELLED" among other possible values, your test will fail. OTOH, if you're using the field as a Boolean (on/off) type, then it would be much more convenient to use the numeric value of 1 instead of the "EXPELLED" text value.

 

Edited by comment

  • Author

HI!

Tnx so much for your answer. After some testing I went with the first solution you proposed. It's not precisely what I was aiming for but it did open some other possibilities which nicely fit into my plan.

BTW... (not related to the current issue)....is there a way FM can recognize hidden status of an object or a field that can be used in a script?

Something like IF Object 1 is hidden THEN.....

Tnx once again!

46 minutes ago, Sinky said:

is there a way FM can recognize hidden status of an object or a field that can be used in a script?

Yes, there is: isObjectHidden is one of possible parameters of the GetLayoutObjectAttribute() function. Alternatively, you could use the same condition as the one used to hide the object. Or, if you want to avoid evaluating the same thing twice, you could set a global variable to the result and use this both to hide the object and in your script.

--
P.S. Please post unrelated questions separately.

 

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.