Tuesday, 5 March 2013

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


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,

  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.


  1. nice post!

    how to concat same 2 fields in subpanel?

    p.s. open quote mark is missed before related_fields in code

  2. Will update with the post on how to concat fields in subpanel.

    Thanks for pointing out the missing quote.

  3. how to make this field linkable. I tried to make it linkable by writing link=>true bt its now working.


Urdhva Tech Pvt. Ltd. Powered by Blogger.

Urdhva Tech

My photo
SugarCRM Consultants Contact us at contact@urdhva-tech.com Skype : urdhvatech

Search This Blog

Stay connected Socially


Total Pageviews

Popular Posts