NetTalk Central

Author Topic: Insert Button on NetWebBrowse  (Read 5811 times)

MikeR

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Email
Insert Button on NetWebBrowse
« on: April 03, 2013, 04:19:23 AM »
I have a netwebbrowse for a file
I have buttons for change and delete in the browse row.
These work fine.
I have included a insert button at the bottom of the rows for the user to do inserts.

However I would like the insert button or (another button) to do the following:

1. I need to hand code the insert.
2. reread it
3 update it
4. then call the update form for the record I just inserted as if it was a change

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Insert Button on NetWebBrowse
« Reply #1 on: April 03, 2013, 02:21:00 PM »
Try adding your converted code below to the end of the following embed

  ! Start of "On Update : Form begins"
  ! [Priority 5000]


        Access:POTRN.UseFile()
        If Access:POTRN.Insert()     
          Message('Unable to Insert POTRN')
        End
        p_web.filetosessionqueue(potrn,net:alsovaluequeue)
        ans = net:ChangeRecord
        p_web.SetSessionValue('FormNewDraftPO:Primed',1)

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Insert Button on NetWebBrowse
« Reply #2 on: April 06, 2013, 07:04:18 AM »
another possible strategy is to change the Form, not the browse.
ie on Insert (PreInsert routine) do what you need to do and set the action to "change".

Indeed the form already has this exact behavior - on the advanced tab there's an option to "pre-insert the record even if not necessary"
- after that you just embed into the PreInsert embed point. If you read the code there you'll see what's going on.

cheers
Bruce

Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Re: Insert Button on NetWebBrowse
« Reply #3 on: April 07, 2013, 11:04:45 AM »
I like Bruce's idea but can't find a PreInsert embed point. Is this the same embed point that Kevin mentioned?.

Thanks.

Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Re: Insert Button on NetWebBrowse
« Reply #4 on: April 07, 2013, 11:06:07 AM »
Argh!  Didn't have allow Inserts checked.  Duh.  Sorry.