Page 1 of 1

New record from parent

Posted: 2015-12-13 22:48
by sharonbetts
I apologize for my lack of SQL knowledge - working hard to learn on my own. I hope that AppGini can help me get this project together.

I have a database holding records for a dog clubs titles. It has 5 tables with one (Demographic) acting as parent in a one-to-many relationship.
When a new record (new dog) is entered, I would like to have records also added to each child table with the RegNo (foreign key fields) populated.

Example
When a new dog is entered into the Demographic table all three fields are populated (RegNo, RegName,Owner)
I want a new record also created in the Drafting table (RegNo, NDD,ODD,DDV,ODDV) with the same RegNo and default values in the other fields).

Is this possible in AppGini? Can it be done via a Hook?

Thank you for any assistance on this.

Re: New record from parent

Posted: 2015-12-15 10:29
by a.gneady
Yes, you can use the Demographic_after_insert() hook to insert the child records. Please refer to the hook documentation for details and examples: http://bigprof.com/appgini/help/advance ... ter_insert