Forums: Best way to update master row when child is updated - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Best way to update master row when child is updated Rate Topic: -----

#1 User is offline   InfoCraftsman 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 28-September 17

Posted 14 October 2017 - 04:23 PM

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.
0

#2 User is offline   DanB 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 15-September 17

Posted 06 December 2017 - 03:32 PM

View PostInfoCraftsman, on 14 October 2017 - 10:23 AM, said:

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.
0

#3 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15762
  • Joined: 03-February 03

Posted 06 December 2017 - 07:34 PM

Use AfterEdit event of child table to update master table. Details depend on what exactly you need to update.
Best regards,
Sergey Kornilov
0

#4 User is offline   DanB 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 15-September 17

Posted 07 December 2017 - 11:08 PM

View Postadmin, on 06 December 2017 - 01:34 PM, said:

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.
0

#5 User is offline   InfoCraftsman 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 28-September 17

Posted 11 December 2017 - 06:30 PM

View PostDanB, on 06 December 2017 - 11:32 AM, said:

View PostInfoCraftsman, on 14 October 2017 - 10:23 AM, said:

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.


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.
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked