Refresh sub-panel values when another sub-panel is updated

Scenario:

New record is added to sub-panel (A) which triggers a logic hook which updates 2 other sub-panels. Problem is that to see the changes we need to reload the page.

I know we can put custom JS which will “listen” to sub-panel changes and when a change takes place it will update other sub-panels, but I’m not sure how to implement it.

There’s an example here: https://community.sugarcrm.com/thread/32308-how-can-i-refresh-a-specific-subpanel-in-the-detailview but I’m not JS savvy enough yet to understand how to implement it

May be someone has an example sitting on their hard-drive somewhere?

Thank you!

Finally found a solution…

To summarize for those reading, you need to create a custom controller in

custom/modules/PARENT_MODULE/controller.php

When you change something in your sub-panel it will generate a new $_REQUEST (in real-time) so when you’re satisfied that the right sub-panel is being manipulated you can fire the showSubpanel(‘FIELD_NAME’,null,true); action.

Here’s a video that explains it:
https://youtu.be/wqLAIp52CIA

2 Likes

Thanks Robert! This is very useful, we need more tutorials like this!

1 Like

Will definitely make more of them, glad you liked it!