This topic is locked

Transaction Control on Master Detail Relationship

12/16/2020 10:38:48 PM
PHPRunner General questions
S
Shodddd author

I was desktop programmer before. Now I try to use PHP. And PHPRunner is the most helpful in my job. I'm creating a master detail relationship add page. And one of the feature that i use the most is Rollback on Exception. If it's a single Table i could use THIS as reference. How can i do Rollback on Exception inside master detail relationship add page? (Btw. I use mariadb for database).

Admin 12/17/2020

That post refers to using rollback when you insert data manually in your events. When you use master-details relationships all data will be added automatically by PHPRunner itself.
Can you explain the whole scenario? Why do you need to use rollback at all?

S
Shodddd author 12/18/2020

When i created master detail relationship Add page for Order and Detail table . I check "required Field" at detail table field item_kode. when I filled in the required field at Order table and purposely did not fill in the "Item Code" in the detail table. if I click save, an error occurs in the required detail table "item code" field. but the record at Order table is entered because there are no error.
What I want is no matter where the error, record from Order and Detail table should rollback.