Page 1 of 1

Partial Save issue

Posted: June 27th, 2022, 8:07 am
by prabhustat
Dear All,

I have issue in partial save, when I adopt the below conditions, its partial saving but when I am resume case, its starts from identification not at last cursor occurrence place. Any have suggestion please

function OnStop()

numeric response = errmsg("What do you want do the data now?")
select("Breakoff / Partial)", continue, "Soft or temporary refusal /Refusal do not contact again", continue, "Cancel", continue);

if response = 3 then
// Cancel
reenter;

elseif response = 1 then
// Save and quit
savepartial();


elseif response = 2 then
// skip to Results
skip to RESULT;
endif;

stop(1); // close the program
end;


Thanks in advance
PP

Re: Partial Save issue

Posted: June 27th, 2022, 12:01 pm
by sherrell
If you use the OnStop function, CSPro's built-in partial case resumption doesn't get invoked. From the help page for OnStop:

https://www.csprousers.org/help/CSPro/o ... ction.html

you'll see it mentions this: If an OnStop function has been coded in a data entry application, then when resuming a partial case, no resume dialog ("Do you want to go to last...") occurs. If special actions are required when entering a partial case, check whether a partial case has been entered using the ispartial function and program the appropriate action. You can retrieve the name and occurrence number of the last field entered (on a one-level application) by calling getsymbol(savepartial).

Therefore, you'll have to write something yourself to handle this. A (generic) example for doing this would be the following:

Code: Select all

// because an OnStop is defined in the application, we have
// to resume from a partial save ourselves

string last_field_entered = getsymbol(savepartial);

if last_field_entered <> "" then

  numeric selection = errmsg("Do you want to resume where you last left off?")  
  				select("Yes", continue, "No", continue);

  if selection = 1 then
    advance to last_field_entered;
  endif;

endif;

Re: Partial Save issue

Posted: June 28th, 2022, 4:52 am
by prabhustat
Thanks lot sherrell