Issues with choose/pick procedures in “view” mode
If you create a choose/pick procedure that uses quotas, you will likely have issues if you try to look at completed cases in view mode.
The problem is view mode does NOT know what the quotas were at the time that the original survey was done. View mode can avoid this problem in “normal” quota checks by using the {!view_quota) command, but that won’t help here as setting the quotas check to be always true or always false won’t be correct either.
There are two ways to avoid this issue.
1) Use expression questions and store the quota values in the data and then use the expressions in your choice logic. When view mode hits the expression questions it does not try to look at the quota value, it will just take the value that is current stored in the location of the expressions.
2) Use the following trick:
Use a PHONE,GET_PHONE_INFO and get “dummy” columns in the phone text and put it in the location of where you “pick” is stored. Use the XF function view_mode_only so that the command won’t be executed in “live” mode. Put the actual pick procedure in a {!-view} block.
In live mode, this shouldn’t effect anything as thePHONE,GET_PHONE_INFOcommand will be skipped over and the regular pick procedure will execute.
In view mode, it will see thePHONE,GET_PHONE_INFOand since it does not have access to the phone record, it will just read in the existing data in that location. Then it will skip the choose procedure entirely.
NOTE: Do NOT use { !-ViewX }
Example:
{ Pickme: Hide!Field1 One2 Two }'Stores in the same location as the choose procdure results a single blank column from the phone text{ [Pickme]!If xf(View_Mode_Only())!Phone,Get_Phone_Info,101,1 }{ !-View } ''turn view mode off so it does not try to redo the choose procedure{ !Rotate,Scramble }{ !If [Pickme ^B] and Quota(one) <= Quota(two)!Generate,Add_Code,Pickme,1 }{ !If [Pickme ^B] and Quota(two) <= Quota(one)!Generate,Add_Code,pickme,2 }{ !EndRotate }{ !view } ''turn view mode back on so it will see the rest of the questions