lost some data after case completed

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Enkhbayar
Posts: 68
Joined: November 10th, 2014, 11:48 pm

lost some data after case completed

Post 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,
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: lost some data after case completed

Post 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).
Enkhbayar
Posts: 68
Joined: November 10th, 2014, 11:48 pm

Re: lost some data after case completed

Post by Enkhbayar »

Actually, I called it from the last variable. Please see the test app from the attachment.
Attachments
auto_assign.zip
(4.51 KiB) Downloaded 286 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: lost some data after case completed

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