NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: MikeR on November 17, 2015, 05:37:19 AM

Title: Netwebform saving info to database on a button other than save button
Post by: MikeR on November 17, 2015, 05:37:19 AM
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 ?
Title: Re: Netwebform saving info to database on a button other than save button
Post by: Bruce 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