NetTalk Central

Author Topic: Form / Inserts  (Read 1897 times)

rjolda

  • Sr. Member
  • ****
  • Posts: 279
    • View Profile
    • Email
Form / Inserts
« on: April 28, 2010, 03:39:39 PM »
Hi,
I have a parent file Update form and there are fields from a child file on the form as well.  I want to handle the child file in code. 
Question:
1. on Insert of a record to the Parent File - Where can I snag the Primary file Unique ID number in code and what is the server variable that holds it.  I can grab it when the INSERT of the parent record is done but I need it when the form opens to be able to get the child record???

2. On Change, I need to grab the child file before the form is created - again, where in code can I grab the Primary Unique ID number and which server variable holds it?

Thanks,
Ron Jolda

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: Form / Inserts
« Reply #1 on: April 28, 2010, 08:55:58 PM »
Hi Ron,

I presume the parent is autonumbered? If so tick on the options to force auto-numbering "early" on the advanced tab. If you don't do this it may only auto-number when the record is saved.

The place to prime stuff on an insert is in the PreInsert routine. At that point the parent record itself may be primed, or you may need to use the session variables.

On change use preChange routine instead of preInsert. There's no specific server variable - the value is either in the file variable, or the session variable. It's preferable to use the session variable I think (if it's primed by the time your code runs)

Cheers
Bruce


rjolda

  • Sr. Member
  • ****
  • Posts: 279
    • View Profile
    • Email
Re: Form / Inserts
« Reply #2 on: April 29, 2010, 02:18:32 AM »
Ahh,
I will look at the Advanced tab - that is what  I need.
Right now, it does NOT get primed until the INSERT mode is called on Save.
Doing the Early Prime should do the trick!
Thanks
Ron