Not entirely sure this will work… but you could maybe create custom ‘ForActivities.php’ and ‘ForHistory.php’ files in /custom/modules/Opportunities/metadata/subpanels/ directory (create the directory if it doesn’t exist). From there, you can include some custom php to limit it to the Accounts module and a custom sql query to limit it to only the current account record. I haven’t looked too closely at the specifics of how you’d do it, but here is some custom ForActivities code I have used previously:
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
$subpanel_layout = array(
// custom query here (make sure to reference the table name, i.e. tasks.status or tasks_cstm. for custom fields)
'where' => "(meetings.status NOT IN ('Held', 'Not Held', 'Cancelled', 'held_no_hire', 'held_no_options', 'Existing', 'rescheduled'))",
// columns for the subpanel
'list_fields' => array(
'object_image'=>array(
'vname' => 'LBL_OBJECT_IMAGE',
'widget_class' => 'SubPanelIcon',
'width' => '2%',
'image2'=>'__VARIABLE',
'image2_ext_url_field'=>'displayed_url',
),
'name'=>array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '42%',
),
'status'=>array(
'widget_class' => 'SubPanelActivitiesStatusField',
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
'sortable'=>false,
),
'contact_id'=>array(
'usage'=>'query_only',
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_start'=>array(
'vname' => 'LBL_LIST_DUE_DATE',
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'assigned_user_id',
'target_module' => 'Employees',
'width' => '10%',
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'close_button'=>array(
'widget_class' => 'SubPanelCloseButton',
'vname' => 'LBL_LIST_CLOSE',
'sortable'=>false,
'width' => '6%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'time_start'=>array(
'usage'=>'query_only',
),
'recurring_source'=>array(
'usage'=>'query_only',
),
),
);
And here’s ForHistory:
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
$subpanel_layout = array(
'where' => "(meetings.status IN ('Held', 'Not Held', 'Cancelled', 'held_no_hire', 'held_no_options', 'Existing', 'rescheduled'))",
'list_fields' => array(
'object_image'=>array(
'vname' => 'LBL_OBJECT_IMAGE',
'widget_class' => 'SubPanelIcon',
'width' => '2%',
'image2'=>'attachment',
'image2_url_field'=>'file_url'
),
'name'=>array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
'status'=>array(
'widget_class' => 'SubPanelActivitiesStatusField',
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
'reply_to_status' => array(
'usage' => 'query_only',
'force_exists' => true,
'force_default' => 0,
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
'sortable'=>false,
),
'contact_id'=>array(
'usage'=>'query_only',
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'parent_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'parent_type'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_modified'=>array(
'vname' => 'LBL_LIST_DATE_MODIFIED',
'width' => '10%',
),
'date_entered'=>array(
'vname' => 'LBL_LIST_DATE_ENTERED',
'width' => '10%',
),
'date_start'=>array(
'vname' => 'LBL_LIST_DUE_DATE',
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'assigned_user_id',
'target_module' => 'Employees',
'width' => '10%',
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'filename'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'recurring_source'=>array(
'usage'=>'query_only',
),
),
);
Good luck!