Hello Developers,
I'm using SugarCRM Community edition 6.5.13 version.
When i use the quickcreate of a certain subpanel, i want other subpanel to be refreshed. how can i do that?
For example: in the Accounts Detailview, when creating a new Opportunity, using the Opportunity QuickCreate view, inside the Opportunity subpanel and pushing "Save" i want the Contacts Subpanel (that also under the Account detailview) to be refreshed (never mind the reason).
i know how to refresh the entire sceen after creating a record in a subpanel, but need to refresh a specific subpanel instead because the refresh of the whole screen, takes a lot of time.
i refresh the whole screen by putting a controller.php file in the Accounts module and calls the refresh like this:
<?php
class AccountsController extends SugarController {
function action_SubPanelViewer() {
require_once 'include/SubPanel/SubPanelViewer.php';
$GLOBALS['log']->fatal(print_r($_REQUEST,TRUE));
// only if this is creation of new sale under accounts, refresh the screen so the salerow subpanel will be refreshed too
if ( array_key_exists('module', $_REQUEST) && array_key_exists('subpanel', $_REQUEST) && array_key_exists('action', $_REQUEST) &&
$_REQUEST['module'] == 'Accounts' && $_REQUEST['subpanel'] == "accounts_opportunities_1" && $_REQUEST['action'] == "SubPanelViewer")
{
$js=<<<EOQ
<script>
window.location.reload();
</script>
EOQ;
echo $js;
}
}
}
?>
How can i refresh a specific subpanel after creating record in other subpanel?
Thank you
You would have to do that in Javascript. You woud override the save() function on the one subpanel and then add code to refresh the subpanel you want. I learned out to do the refresh from here
http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.8/User_Interface/Views/Refreshing_Subp…
So, without actually doing it, I would look into over riding the _save() function in clients/base/fields/editablelistbutton/editablelistbutton.js on Opportunities and refresh your subpanel from there. Just a quick pre-breakfast guess. Not sure if thats enough to get you started or not, let me know.