when the record is inserted, the primarey key id value of the record is stored in a session variable. This allows you to create your relations ships when the records are stored in the other tables by using this session variable in the foreign key columns.