How do I "taste" if value in a checkbox is true or false?
I have a few checkboxes in the form, and some is true..some is false when users activate those. When I "run" som code.. I have to "taste" which checkbox is false and which is true....like this:
if "chkBox_01 value" then
..some code
else begin
..some code
end
...and... how do I set a checkbox TRUE from the C/AL code?
Rainer
Kind Regards
E-mail:
info@rainerbay.dk
Skype: rainerbaydk
0
Comments
To see what value the checkbox has you should look at the value of the "SourceExpr" of the checkbox.
Also by setting the value of the "SourceExpr" to true you will check the check in the checkbox. When set to False you uncheck the checkbox.
http://www.codegeniusstudio.com
http://www.facebook.com/CodeGeniusStudio
Each checkbox on your form should have a boolean variable in its SourceExpr property that is defined as a global variable, so you can access its value anywhere in the object code.
So let's say we have a gobal boolean variable called MyCheck, and it is et as the SourceExpr on the form. In your code, you'd do something like this: For one evaluation the parentheses are not necessary, but it's the most complete you can get.
To set the value of the checkbox, you use the assignment operator ":=", like this:
I would personally not put TRUE or FALSE directly into the SourceExpr, because then you can't manipulate the value, and that makes the checkbox meaningless.
Let me know if you need more information.
RIS Plus, LLC
Does not need to be a variable. Field in a table is also possible.
You set the value of the variable (or field) to TRUE (or FALSE) and this variable (or field) is defined in "SourceExpr". I never said put true or false in SourceExpr... That would be a NO NO... [-X
http://www.codegeniusstudio.com
http://www.facebook.com/CodeGeniusStudio
I didn't think you'd suggest anything like that, I just thought because of the way you said this maybe someone would read it that way and I wanted to make sure that they use variables.
RIS Plus, LLC