on 11-23-2023 2:22 PM
I need to write down the information: yes/no. This is a logical bool value. But I still want to know whether this value has been set or not. Ideally, you'll want to have a data type that starts null.
Then I could check:
var foo = this.Answer;
if (foo.IsSet())
{
if (foo) then ... else ...
}
I would also like there to be a UI element for this, which would be grayed out if this.Answer is equal to null, marked with a check mark if it is true, etc.
Hi Tomasz,
How about this? Answer field data type comes from a custom created .codelist, having the value 1-Yes and 2-No.
Considering that the variable foo holds the value from Answer (which can either Yes/No/Null), you can use IsInitial() to valide if the variable is null or not.
var foo = this.Answer;
-> if (foo.IsInitial()) //Answer is null
-> if (!foo.IsInitial()) //Answer is either yes/no
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.