Hello Jorge-
There are probably multiple ways of doing something like this. I've been very successful using "Memory" as the source of the form and using local variables to hold the information to be updated. The following example shows the embeds and code I use:
InitForm / 1 Start = !! Look for delete. This logic gets around the fact that you go through here twice on a delete:
IF BAND(p_Stage, 255) = Net:DeleteRecord
IF p_web.GetValue('DeleteContactID') = 0
p_web.SetSessionValue('Loc:RequestAction', '2')
p_web.SetValue('DeleteContactID', p_web.GSV('AFcon:ContactID'))
DO Get:ContactValues
DO Save:ContactValues
END
END
PostUpdate / 1 Start
DO Save:ContactValues
PreUpdate / 1 Start = !! Prepare for change
IF p_web.GetValue('insert_btn') <> ''
p_web.SetSessionValue('Loc:RequestAction', '0')
ELSIF p_web.GetValue('change_btn') <> ''
p_web.SetSessionValue('Loc:RequestAction', '1')
ELSE
p_web.SetSessionValue('Loc:RequestAction', '-1')
END
DO Get:ContactValues
The loc:RequestAction is a session variable I use to track the request; 0=Insert, 1=Change, 2=Delete. The Get and Save routines are where you retrieve your local values from your db, save your local values back to the db or delete your database row(s). I leave those to your imagination. Start with something simple so that you can get the hang of the flow.
HTH,
Gordon