Adding a Link in a SugarCRM Dashlet

I’m going to use the Tasks Module as an example. I will link the ‘Contact’ field to the contacts module detail view.

Open /modules/Tasks/Dashlets/MyTasksDashlet/MyTasksDashlet.data.php

Initially it looks like this:


'contact_name' => array(
 'width'   => '8',
 'label'   => 'LBL_LIST_CONTACT'
),

To make this field link to the contacts module:

'contact_name' => array(
 'width'   => '8',
 'label'   => 'LBL_LIST_CONTACT',
 'link' => true,
 'action' => 'DetailView',
 'module' => 'Contacts',
 'id' => 'CONTACT_ID',
 'related_fields' => array('contact_id')
 ),

The main fields are:
link: True/False
module: The name of the destination module
action: DetailView or EditView
id: The field that contains the ID for the related field. If it doesn’t work lower case, try it in uppercase
related_fields: The field that contains the relation ID – This should be the same as ‘id’

  1. No comments yet.

  1. No trackbacks yet.