Adding a Link in a SugarCRM Dashlet

Open::
/modules/<MODULE>/Dashlets/My<MODULE>Dashlet/My<MODULE>Dashlet.data.php

Let we want to make link for “opportunity” field of any Dashlet.

Initially “opportunity” array looks like this:

'opportunity' =>
array (
'width' => '10%',
'label' => 'LBL_OPPORTUNITY',
'name' => 'opportunity',
'default' => false,
),

Then make it likes:

‘opportunity’ =>
array (
'width' => '10%',
'label' => 'LBL_OPPORTUNITY',
'name' => 'opportunity',
'link' => true,
'action' => 'DetailView',
'module' => 'Opportunity',
'id' => 'OPPORTUNITY_ID',
'related_fields' => array('opportunity_id'),
'default' => false,
),

The main array keys which we need:

link: True/False; True will make it link.
module: Destination Module Name.
action: View Name; DetailView or EditView
id: The field that contains the ID for the related field. Use uppercase to ignore any problem.
related_fields: The field that contains the relation ID, should be the same as ‘id’

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.