Hi Jeff,
>> My first choice would be to save the partial data, so the user can go back and pick up where they left off.
You can do this easily enough.
a) create a routine to do the partial save. This would be something like;
Access:whatever.Open()
Access:whatever.Usefile()
file:guid = p_web.getsessionvalue('file:guid')
If Access:whatever.Fetch(file:guidkey) = Level:Benign
p_web.SessionQueueToFile(whatever)
Access:whatever.TryUpdate()
end
Access:whatever.Close()
Then call this routine from the validate::xx routine for each field (xx) where you want to partially save.
>> Only fields such as GUID and Patient_ID, are saved at expiration.
Given that nothing is saved on expiration, it would suggest these fields are set, and the record created, when the form opens.
>> The Study_ID which is primed/constructed in the validate Insert embed, is not getting set at expiration.
Expiration happens on the _server_ not the client. (The client can, and often does, have a separate timer, but it's unrelated to the server)
>> I tried priming the Study_ID on the Templates Priming tab (on insert), but it did not work.
I'm sure it did work (ie prime) at that point, but it happened after the record was created, so did not save.
>> A question here is, does the auto-incremented Patient_ID get set upon Insert or only at Save?
depends on your settings (advanced tab) and also your use of auto-numbering (with child procedures, like browses).
It tries to do it at the end, but in your case it's happening at the beginning.
>> I would also like to display a page to the user, if they let the session timer expire.
there are numerous examples that have this code in the PageFooterTag procedure.
p_web.Script('startCountDown('& int(p_web.site.SessionExpiryAfterHS/100) &',"' & clip(p_web.site.DefaultPage) & '?logout_btn=logout_btn","countdown");')
this can be coupled with a DIV on the page; something like
<div class="nt-right nt-countdown">Session Expires In:<<div id="countdown"><</div><</div>
to show the countdown to the user.
regardless of whether it is visible or not, the countdown redirects to the second parameter if it gets to 0.
Note this is all client-side code and while it mimics the server-side session ending, it's not actually related to the server-side session ending...
cheers
Bruce