NetTalk Central

Author Topic: Saving records while in a form?  (Read 3334 times)

spot1701

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Saving records while in a form?
« 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
Thanks

Bryan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Saving records while in a form?
« Reply #1 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

spot1701

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: Saving records while in a form?
« Reply #2 on: May 22, 2009, 12:20:18 AM »
Thanks
Thanks

Bryan