Jump to content

Checkbox value via script issue


This topic is 1042 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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!

Link to comment
Share on other sites

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
  • Thanks 1
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This topic is 1042 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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