AnsweredAssumed Answered

HOW TO: Link a Campaign Log subpanel back to the proper entity

Question asked by Tim Turnquist on Oct 21, 2015
My sales staff's only complaint about the Campaign Status page is that there was no way to get directly from that page to those who Viewed that email or Clicked on a link. They wanted a way to click on the Recipient's name and go right to the record.

The report is nearly all plain text with no links like this:

After a few hours of reading forums and blogs about similar tasks, but not really the same, and trying endless combinations of customizing the module output or the listview I realized that there is a very simple way to do this -- one I have not seen before. So, I thought I would post it here and hopefully help someone else who can't readily find the answer.

First of all, to make this upgrade-proof, copy the file modules/CampaignLog/metadata/subpanels/default.php to custom/modules/CampaignLog/metadata/subpanels/default.php. Open the copy that is in the custom folder and change this:
. . .   'list_fields' => array(      'recipient_name'=>array(
        'vname' => 'LBL_LIST_RECIPIENT_NAME',
        'width' => '14%',
    'recipient_email'=>array(   . . .
to this:
. . .   'list_fields' => array(
        'vname' => 'LBL_LIST_RECIPIENT_NAME',
        'width' => '14%',
        'widget_class' => 'SubPanelDetailViewLink',
        'target_record_key' => 'target_id',
        'target_module_key' => 'target_type', 
        'parent_id' =>'related_id',
    'recipient_email'=>array(  . . .
and that is all it takes to get links that work -- like this: