SugarCRM: Make other field in Listview as a link to Detailview

sugarcrmdevelopers —  May 21, 2013

Sometimes you dont need to use the name in a module as a link in Listview to redirect you to the Detailview of the record. If you want to set other fields in Listview as the link that will redirect you to Detailview, then follow this simple steps:

1. Go to custom/modules/<MODULE_NAME>/metadata/listviewdefs.php (If not existing, copy file from modules/<MODULE_NAME>/metadata/listviewdefs.php)
2. Find the field name that you want to make as the link. For example, use Billing City. It will look something like this:

array (
'width' => '10%',
'label' => 'LBL_LIST_CITY',
'default' => true,

3. You need to add the the link attribute and set it to true.

array (
'width' =&gt; '10%',
'label' =&gt; 'LBL_LIST_CITY',
<strong>'link' =&gt; true,</strong>
'default' =&gt; true,

* If you want to make the name just plain text, comment the link attribute of the field in the same file.
4. Run Quick Repair and Rebuild in Administration page.

This is an upgrade safe way of making a field as a link to go to Detailview.