Search code examples
sugarcrmsuitecrm

Reload a subpanel when another subpanel's values are changed


There is a logic hook that fires when values of sub-panel (A) are updated, when that happens 2 more additional sub-panels are updated through a logic hook, but we can't see the changes unless we reload the page.

I'm trying to find a way to update the values in the other 2 sub-panels without a page reload.

I know it's possible to add custom JS to detailview that will listen to sub-panel updates and when they take place it will update more sub-panels (described here: https://community.sugarcrm.com/thread/31390-how-do-i-refresh-a-subpanel-when-a-record-is-added-to-a-different-subpanel), but all code examples are for later versions. I can't find any examples for the suitecrm or sugarCRM CE.

Would appreciate if someone can point me in the right direction.


Solution

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

    Following tutorial explains it step by step: https://www.youtube.com/watch?v=wqLAIp52CIA