NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: MikeR on April 03, 2013, 04:19:23 AM

Title: Insert Button on NetWebBrowse
Post by: MikeR 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
Title: Re: Insert Button on NetWebBrowse
Post by: kevin plummer 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)
Title: Re: Insert Button on NetWebBrowse
Post by: Bruce 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
Title: Re: Insert Button on NetWebBrowse
Post by: Jim A 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.
Title: Re: Insert Button on NetWebBrowse
Post by: Jim A on April 07, 2013, 11:06:07 AM
Argh!  Didn't have allow Inserts checked.  Duh.  Sorry.