NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: kevin plummer on March 22, 2010, 03:40:52 PM
-
Hi All,
After a form opens in insert record mode I want to add the record and change to change record mode.
I have added the following to the preinsertafterprimes embed but if I click ok on the form it wants to insert the record again. Is there another SSV I need to change or is even what I am trying to do possible?
Cheers,
Kevin
Access:POTRN.UseFile()
If Access:POTRN.Insert()
Message('Unable to Insert POTRN')
End
p_web.SetSessionValue('POPurchaseOrderEntryForm_CurrentAction',Net:ChangeRecord)
loc:action = p_web.site.ChangePromptText
loc:act = Net:ChangeRecord
-
WAG: On Save, When inserting -"Insert Another" -- on your updateform?
FWIW - i have done something like this where i embed my insert, but come into the form in Change mode.
Would be interested to know if you can easily flip loc:act...
-
On save I return to the Browse.
I have thought about coming in as change mode but that means I would have to add my own insert and change buttons to the browse and I'm trying to avoid that at the moment as it is a big app.
I think I need the wisdom of Bruce to know if there is an easy way to do this...
-
Hi Kevin,
the correct thing to so is return the new action from the PreInsert routine.
(you can also change the action in PreUpdate and preDelete)
To change the action set ans = newaction, ie in your case
ans = net:ChangeRecord
The rest (should be) automatic.
cheers
Bruce
-
Thanks Bruce. Do I need to change Loc:Action and Loc:Act or just changing the ans will clean this up?
-
I think just changing ans. Keep us posted...
cheers
Bruce