NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: kevin plummer on March 22, 2010, 03:40:52 PM

Title: How do I change Insert form to change form
Post 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
Title: Re: How do I change Insert form to change form
Post by: Poul on March 23, 2010, 06:51:12 AM
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...   

Title: Re: How do I change Insert form to change form
Post by: kevin plummer on March 23, 2010, 03:11:53 PM
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...
Title: Re: How do I change Insert form to change form
Post by: Bruce on March 24, 2010, 03:29:56 AM
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


Title: Re: How do I change Insert form to change form
Post by: kevin plummer on March 24, 2010, 06:10:53 AM
Thanks Bruce. Do I need to change Loc:Action and Loc:Act or just changing the ans will clean this up?
Title: Re: How do I change Insert form to change form
Post by: Bruce on March 25, 2010, 06:01:06 AM
I think just changing ans. Keep us posted...

cheers
Bruce