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

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 you find this blog post helpful.

Feel free to add comments and queries, that helps us to improve the quality of posts.

You can contact us at info@infotechbuddies.com

Thank you.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *