Dear all,
I have a problem when I make an automatically end-time for more than once visitation in a survey.
When the application ended on a partial save, the end-time will be filled in automatically.
And I wrote the script in each item as I don't know in which item the user will use partial save function.
Here is my script for automatically end-time in a partial save mode:
Are you using system controleld mode and are the variables for end time on a form after the field where the partial save is taking place? If so then they will be off path and the value would be notappl. You would need to use visualvalue() to read them.
Also ispartial() does not tell you if the case is in the process of being partially saved. It tells if you the case was partially saved last time. I think you what you want to do is to add a custom onstop function (http://www.csprousers.org/help/CSPro/on ... ction.html) and add set the end time in that function.
function OnStop()
savepartial();
if visualvalue(END_HOUR_1) = notappl then
END_HOUR_1 = systime("HH");
END_MINUTE_1 = systime("MM");
elseif visualvalue(END_HOUR_1) <> notappl and visualvalue(END_HOUR_2) = notappl then
END_HOUR_2 = systime("HH");
END_MINUTE_2 = systime("MM");
elseif visualvalue(END_HOUR_1) <> notappl and visualvalue(END_HOUR_2) <> notappl and visualvalue(END_HOUR_3) = notappl then
END_HOUR_3 = systime("HH");
END_MINUTE_3 = systime("MM");
endif;
stop(1);
end;
It didn't worked. It shows a blank record in my end-time item when I checked it out via export data to .csv.
Because we don't know where the user will use savepartial(), so I used the script without last_field description.
I'm still trying to get the right answer.
But again, kindly please help me.
If you are using operator controlled mode then visualvalue is not the problem. In operator controlled mode you always get the visualvalue.
Try moving the savepartial() just before the stop(1). They way your logic is now you are doing the save BEFORE you set the endtime so the endtime does not get saved.