NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Gordon Holfelder on October 04, 2010, 02:36:33 PM
-
Hi All-
Back to working on my NT5 app and have run into a problem. I have a table bowse calling a memory form (I have different tables I want to update) and need to catch insert vs change vs delete. I've set debugger break points in the PreInsert, PreUpdate and PreDelete routines and the only one I'm getting to is the PreUpdate
Is this because it's a memory form or am I missing something?
Is there a GSV or GV that will tell me what button was pressed?
Thanks,
Gordon
-
Is this because it's a memory form or am I missing something?
> yes. change is the std behaviour
Is there a GSV or GV that will tell me what button was pressed?
> there is a GV on a normal form although you would need to check your logging window to see if this is different on a memory form. If it is you could just create your own ins, chg and del buttons and pass whatever values you like to the memory form.
-
Hello Kevin-
RE: My own buttons: I like the messaging, etc. that is associated with the standard buttons. I'd like to not have to do this for every browse where I have to use this technique.
I have found the following code in the PreUpdate routine lets me determine if this is a insert or change:
IF p_web.GetValue('insert_btn') <> ''
DO PreInsertStuff
ELSIF p_web.GetValue('change_btn') <> ''
DO PreChangeStuff
ELSE
Not sure why we would be here
END
Interesting that on an insert it get's here once and on a change twice. For a delete though, the only way to trap it is in the InitFormEnd embed point:
IF BAND(p_Stage, 255) = Net:DeleteRecord
DO PostDeleteStuff
END
The only problem is that it goes through here twice with no difference that I can tell (I've looked at p_stage and it doesn't change). Any ideas how I can make the delete happen once?
Thanks,
Gordon
-
On the first pass set a value
p_web.SetValue('BeenHereDoneThis',1)
Then wrap your init code in a test for the value
If p_web.GetValue('BeenHereDoneThis') = 0
Cheers
Bruce
-
Hello Bruce-
Thanks. That did the trick.
See you soon,
Gordon