Home

This PHPMaker 2024 project will show you how to insert a Master record along with its Multiple Detail Tables at once. If any of data from detail table is not successfully inserted to its table, then all the related records must be rolled back.

The question is, how to make sure ALL the related records are inserted? How to make sure also, when one of the record that should be inserted to a Detail Table is failed, then another records for another Detail Tables should be canceled immediately, including the Master record, too!

The answer is this project. We will use Customers as a Master Table, and three Detail tables involved: Customer Address, Customer Email, and Customer Phone. We will learn how to make sure all the related records must be inserted for a Master table along with its Multiple Detail Tables.

A Customer can have multiple Address, multiple Email, and multiple Phone number. In this example, we must ensure that each Customer at least has one record in each of those Detail Tables above. All those records must be inserted at once from Master/Detail Add page.

We will learn how to implement Master/Detail with multiple Detail Tables, especially after all the related records are already processed by system. We will be able to know in which event should we write the code in order to implement this ALL OR NOTHING logic.

We will also learn, what is the order of process that will involve three Detail Tables along with a Master Table. We will use Log() global function to log the order of Row_Inserted and Row_Deleted server events.

If you want to test how to abort the inserting process for the Detail Tables, then simply enter TEST word into either for one of these 2 following fields: Address OR Phone field.