Dynamic Value Sets from Checkboxes

Discussions about creating CAPI applications to run on Android devices
gbos
Posts: 51
Joined: June 18th, 2015, 7:49 pm

Re: Dynamic Value Sets from Checkboxes

Postby gbos » November 24th, 2017, 2:33 pm

: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
........

josh
Posts: 1692
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Dynamic Value Sets from Checkboxes

Postby josh » November 24th, 2017, 7:24 pm

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...

khurshid.arshad
Posts: 335
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan
Contact:

Re: Dynamic Value Sets from Checkboxes

Postby khurshid.arshad » November 25th, 2017, 2:50 am

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.

josh
Posts: 1692
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Dynamic Value Sets from Checkboxes

Postby josh » November 25th, 2017, 8:11 am

You need to add the function isChecked in the proc global. See attached.
Attachments
CHECK ALL THAT APPLIES.zip
(5.44 KiB) Downloaded 73 times


Return to “Android”