Concate 2 fields in list view without using process record logic hook

sugarcrmdevelopers —  March 12, 2013
Greetings!!

To do: Concatenate values of different fields in one column, without using process record logic hook.

Just a step: Go to custom/modules/<MODULE_NAME>/metadata/listviewdefs.php, if you dont find it there, go to Admin > Studio > <MODULE_NAME> > Layouts > List View > Save and Deploy, which will generate that file for you to modify.

Just for an example, we will here merge, Contact’s Office Phone with a custom field named “Extended Phone”.

I created the Extended Phone custom field through studio, so I got the field name extended_phone_c.

In listviewdefs in I change the definition of the filed like,

‘PHONE_WORK’ =>
  array (
    ‘width’ => ‘15%’,
    ‘label’ => ‘LBL_OFFICE_PHONE’,
    ‘default’ => true,
   related_fields’ =>
    array (
      0 => ‘extended_phone_c’, // your field name in all small letters
    ),
      ‘customCode’ => ‘{$PHONE_WORK} | {$EXTENDED_PHONE_C}’, // your field name in ALL CAPITAL LETTERS
  ),

And thats it! Refresh list view.

Hope this helps.

Feel free to drop your valuable comments.