NetTalk Central

Author Topic: Add record and switch to change  (Read 3134 times)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Add record and switch to change
« on: January 22, 2015, 05:21:31 PM »
When I insert a record from a browse I go to a form. I would like to add a record and then switch to change mode. I'm trying to do this in the pre-insert embed. The following code used to work in NT7 in the pre-insert embed. I'm trying this in NT8. Any suggestions?

      p_web.filetosessionqueue(potrn,net:alsovaluequeue)
      ans = net:ChangeRecord
      p_web.SetSessionValue('FormNewDraftPO:Primed',1) 




Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Add record and switch to change
« Reply #1 on: January 22, 2015, 10:22:21 PM »
Hi Kevin,

the auto-inc obviously does exactly this. Looking though that code it seems to boil down to

  Self.FileToSessionQueue(File,Net:AlsoValueQueue)
  Ans = Net:ChangeRecord
  p_web.SetSessionValue('Procedure:Primed',1)


and this needs to be before
do SetFormSettings

But that looks like what you are doing, so perhaps this _is_ working? And something else is wrong?

Cheers
Bruce


kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Add record and switch to change
« Reply #2 on: January 22, 2015, 11:28:55 PM »
Hi Bruce,

sorry, had it in the wrong embed in pre-insert - still works!

Cheers,

Kevin