Page 1 of 1

lost some data after case completed

Posted: August 10th, 2017, 3:36 am
by Enkhbayar
Hi,

I lost auto assigned variable values after case completed (after I called the command "endlevel").

for example:

PROC S2Q1
postproc

if $ =2 then
S2Q2=1;
move to S2Q3;
endif;

in partial save, I have data for S2Q2, but once the case completed, I lost it.

How to avoid this issue,

Thanks,

Re: lost some data after case completed

Posted: August 10th, 2017, 6:44 am
by josh
In system controlled mode, when you call endlevel it is the same as skipping to the end of the questionnaire. That means that any fields in between the current field and the end are skipped. So if you have the following fields on your form:

A
B
C
D

and you call endlevel from the postproc of field B then C and D will be skipped.

The simplest solution is to put the auto-assigned fields before the field where you call endlevel (or call endlevel from the last auto-assigned field).

Re: lost some data after case completed

Posted: August 10th, 2017, 7:19 am
by Enkhbayar
Actually, I called it from the last variable. Please see the test app from the attachment.

Re: lost some data after case completed

Posted: August 10th, 2017, 8:43 am
by josh
In this case the problem is not the endlevel but the calls to "move to". When going to a forward (to field a after the current field) "move to" is the same as "skip to". So you are skipping over those fields and then when case is saved they become empty. You can see that on the form because they are colored grey instead of green. Instead of using "move to" try using "advance to". This moves through the field but does not skip.