Page 1 of 1

Condition on exit after partial save

Posted: July 18th, 2020, 6:38 pm
by Boni
Dear all !!!
I would like to know how to put a condition at the exit of the application after partial save. For example, I joined an external dictionary of Status, I can put a function at the global Postproc, for the end of the questionnaire (completely filled) the variable "Result Status" = "Complete" then I would like to do the same thing with partial save, but it does not work.In fact, I want to update the status file with each partial Save because I want to know the status of each questionnaire before revive it.
I want to make a trick of the genre, at the exit after partial save:

Postproc HOUSEHOLD_FF
if ispartial() then
hhStatusCode = 2;
Writecase (Status_Dict);
endif;


How can it walk, please?

Re: Condition on exit after partial save

Posted: July 19th, 2020, 3:46 pm
by Gregory Martin
I suggest that you put code like this in your level preproc/postproc, something like this:
PROC CENSUS_LEVEL

preproc

    // when the case is opened, set the status to partially saved
   
CASE_PARTIALLY_SAVED = 1;

    // after this, any time the case is partially saved, this flag will be set to 1

postproc

    // when the entire case is completed, right before the case is saved, modify
    // that flag to indicate that it is no longer partially saved
   
CASE_PARTIALLY_SAVED = 0;

Re: Condition on exit after partial save

Posted: July 19th, 2020, 5:37 pm
by Boni
Thank you dear Gregory !