This topic is locked

Best way to update master row when child is updated

10/14/2017 12:23:11 PM
PHPRunner General questions
I
InfoCraftsman author

I have a classic order/transaction situation. When I edit the child record the transaction total is updated. I have a trigger which automatically updates the order total. What is the best way in PHP Runner to update the master row view.

D
DanB 12/6/2017



I have a classic order/transaction situation. When I edit the child record the transaction total is updated. I have a trigger which automatically updates the order total. What is the best way in PHP Runner to update the master row view.


Hi InfoCraftsman - any solution on this? I have same issue.

admin 12/6/2017

Use AfterEdit event of child table to update master table. Details depend on what exactly you need to update.

D
DanB 12/7/2017



Use AfterEdit event of child table to update master table. Details depend on what exactly you need to update.


The master is getting updated (via a database trigger) - but the column value showing in the list page is not refreshed.
-- oops sorry, I see something in the manual. I'll try it.

I
InfoCraftsman author 12/11/2017



Hi InfoCraftsman - any solution on this? I have same issue.


Not yet, I'm playing with some JavaScript code to update that row but it's going to be a real pain in the neck and I don't really want to update the order row until the transaction is actually saved. So far from what I can see I don't have access to the JavaScript tab in the event when the record is saved. I even tried to force a page refresh (not ideal) but that didn't even work. I think something needs to happen when the transaction row is saved. I'll keep you posted.