NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: spot1701 on May 21, 2009, 07:58:07 AM

Title: Saving records while in a form?
Post by: spot1701 on May 21, 2009, 07:58:07 AM
Say I'm in a form, and the user changes one of the field and at that point I want the save the whole record (and many some child records), but I don't want to leave the form, or wait until they eventually click save.

The way I think I should do this is to reload the file from the session queue and update the record, eg.:

access:jobs.clearkey(job:RecordNumberKey)
job:RecordNumber = p_web.gsv('job:RecordNumber')
! reget the current record from the file
if ~access:jobs.fetch(job:RecordNumberKey)
    ! put the session values back into the file
    p_web.sessionqueuetofile(jobs)
    access:jobs.update()
end


Am I doing this right? Or is there a better way?

TIA
Title: Re: Saving records while in a form?
Post by: Bruce on May 21, 2009, 08:00:42 AM
That's pretty much it Bryan.
Although depending on where you are in the code you may need to manually OPEN, USEFILE and CLOSE the file as well.

Cheers
Bruce
Title: Re: Saving records while in a form?
Post by: spot1701 on May 22, 2009, 12:20:18 AM
Thanks