NetTalk Central

Author Topic: Netwebform saving info to database on a button other than save button  (Read 3214 times)

MikeR

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Email
I have a netwebform
i also have a button on the form that calls another procedure
I want to update the fields to the database before i call the procedure ie. not pressing the save button
is this possible ? how do i do it ?
I tried p_web.updatefile ?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Netwebform saving info to database on a button other than save button
« Reply #1 on: November 17, 2015, 11:52:22 PM »
Hi Mike,

you can update the database wherever you like, and after what-ever event best works for you. I guess the problem boils down to;
a) find the right embed point.
b) write the record.

I recommend using the various DebugView settings to see what evernt are firing, and what handlers are being called etc. That should make part (a) straight-forward enough. (If not then ask in the user group and we'll cover the technique.)

For (b) the important thing to note is that the file is problem not open, and the record to update is not loaded. So you need to do it all;

Access:table.Open()
Access:table.UseFile()
tab:Guid = p_web.GSV('tab:guid')
Access:table.Fetch(tab:GuidKey)
tab:something = p_web.GSV('something')
Access:Table.TryUpdate()
Access:Table.Close()


Cheers
Bruce