Page 2 of 2

Re: Dynamic Value Sets from Checkboxes

Posted: November 24th, 2017, 2:33 pm
by gbos
:D :D Many thanks my dear friend khurshid . This has solved my problem, absolutely. Your solution is so beautiful and is not one i ever knew before. So, thanks a million times.

Regards
........

Re: Dynamic Value Sets from Checkboxes

Posted: November 24th, 2017, 7:24 pm
by josh
To use the isChecked function you would just change the logic in @khurshid.arshads example to:

Code: Select all

	if isChecked("01", S4Q7) then A_WHEATHER = 1 else A_WHEATHER = 2; endif;
	if isChecked("02", S4Q7) then B_CROP_VARIETIES = 1 else B_CROP_VARIETIES = 2; endif;
	if isChecked("03", S4Q7) then C_NEW_AGRICULTURAL_PRACTICE = 1 else C_NEW_AGRICULTURAL_PRACTICE = 2; endif;
	etc...

Re: Dynamic Value Sets from Checkboxes

Posted: November 25th, 2017, 2:50 am
by khurshid.arshad
Dear Josh
Thanks for this code. In my code, we can assign only one option "Yes" OR "NO".

I have tried ischecked function but it is not working. The error message is:
ERROR: 'isChecked' is not a declared variable or is a misspelled dictionary entry
ERROR: Single variable - cannot have subscript (unexpected left parenthesis) near line 4 in S4Q7 procedure


I have Version 7.0.2 dated 29 June 2017 and 7.1.0 (beta) dated 21 November 2017.

Please advice.
thanks.
a.

Re: Dynamic Value Sets from Checkboxes

Posted: November 25th, 2017, 8:11 am
by josh
You need to add the function isChecked in the proc global. See attached.