Here is my solution, although I don’t like it much and it probably isn’t upgrade safe.
I edited /suitecrm/modules/History/metadata/subpaneldefs.php:
'Emails' => array(
'columns' => array(
array(
'name' => 'nothing',
'widget_class' => 'SubPanelIcon',
'module' => 'Emails',
'width' => '2%',
),
array(
'name' => 'name',
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '28%',
),
array(
'name' => 'status',
'vname' => 'LBL_LIST_STATUS',
'width' => '10%',
),
array(
'name' => 'contact_name',
'module' => 'Contacts',
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '20%',
),
array(
'name' => 'parent_name',
'module' => 'Emails',
'vname' => 'LBL_LIST_RELATED_TO',
'width' => '22%',
),
array(
'name' => 'date_modified',
//'db_alias_to' => 'the_date',
'vname' => 'LBL_LIST_LAST_MODIFIED',
'width' => '10%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelEditButton',
'module' => 'Emails',
'width' => '4%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelRemoveButton',
'linked_field' => 'emails',
'module' => 'Emails',
'width' => '4%',
),
),
'where' => "(emails.status='sent')",
'order_by' => 'emails.date_modified',
to this (the ‘where’ is what was modified):
'Emails' => array(
'columns' => array(
array(
'name' => 'nothing',
'widget_class' => 'SubPanelIcon',
'module' => 'Emails',
'width' => '2%',
),
array(
'name' => 'name',
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '28%',
),
array(
'name' => 'status',
'vname' => 'LBL_LIST_STATUS',
'width' => '10%',
),
array(
'name' => 'contact_name',
'module' => 'Contacts',
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '20%',
),
array(
'name' => 'parent_name',
'module' => 'Emails',
'vname' => 'LBL_LIST_RELATED_TO',
'width' => '22%',
),
array(
'name' => 'date_modified',
//'db_alias_to' => 'the_date',
'vname' => 'LBL_LIST_LAST_MODIFIED',
'width' => '10%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelEditButton',
'module' => 'Emails',
'width' => '4%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelRemoveButton',
'linked_field' => 'emails',
'module' => 'Emails',
'width' => '4%',
),
),
'where' => "(emails.status='sent' AND emails.type!='out')",
'order_by' => 'emails.date_modified',
I think this probably only works because we’re not using the SuiteCRM email client, therefore all ‘out’ messages are from workflow. Emails that we add from the Outlook plugin or from just clicking the “Archive” button in a record show up as ‘archive’ or ‘archived’… I can’t remember which.