NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Pauly on August 31, 2012, 05:05:47 AM
-
Hi,
In a memory form (or a table form for that matter) I simply want to run some code when the form is completed.
That is.. when the user clicks the 'Save' button, _or_ presses enter.
Try as I might, the embed point eludes me.. there just HAS to be a place when I can put some code (lets say p_web.Popup('Closing') ) that will be run any time the form is completed by the user clkicking the save button _or pressing enter.
Advice please?
Pauly
-
PostUpdate routine in the form.
You can also embed in the Browse in the
GoFocusBack routine.
Cheers
Bruce
-
G'day Bruce,
I have attached an example - Can you please put 'p_web.popup('Hi Paul') in the appropriate embed point (in the procedure formproc) that will run both when the user clicks on the save button and wne the user presses enter (while in the form of course)- Buggered if I can find it.
Thanks
Pauly
[attachment deleted by admin]
-
Hi Pauly,
perhaps it's worth going back to your original question;
>> In a memory form (or a table form for that matter) I simply want to run some code when the form is completed.
that's in the embed point mentioned. (try putting a STOP in there, and you'll see it.)
BUT;
>> lets say p_web.Popup('Closing') ) that will be run any time the form is completed
if you want something to be "pushed" to the browser at this point, now that's a _very_ different question. Remember you are working inside a request/response environment, so you can't just "push stuff to the browser" in all cases - context becomes very important.
So maybe you need to narrow down exactly _what_ you are wanting to do in this embed point...
cheers
Bruce
-
Hi Bruce,
I just want some code to run - In particular, this code will be adding or updating a table record, after calculating some values from session variables. Not pushing or pulling anything. I just need a place (or two if I have to!) that will run the same code when a user either clicks on the save button, or presses enter.
By the way - the users of this application see pressing enter, and clicking on 'the button other than cancel' as exactly the same thing operationally :-)
Thanks
Paul
-
Maybe I will rephrase -
I want the form to be 'completed' when the user clicks save, _or_ presses enter, and I would like to run some code at that point.
-
Hi Paul,
I do it all the time. I use memory forms when there is a couple of related tables involved, In the Pre-Update-3End embed point I read all the records or set session values as appropriate, and then
the Validate All-2End point I do whatever I want to do with whatever happened on that form.
Cheers
Charl
-
Hi Pauly,
The "Post" routines are ideal. PostInsert, PostUpdate, PostCopy and so on.
You can put logging in there to see them rum. eg
p_web._trace('In Post Update')
cheers
Bruce
-
Thanks Guys that got it.
Small steps.
Pauly