Add in "name" field in listview

Hi!

I need to add more information in clickable ā€˜nameā€™ field in a list view. Now there is only 'first name" and ā€œlast nameā€, but i also need to add ā€œfather nameā€. I tried to add it in a custom\modules\ModuleName\metadata\listviewdefs, but it didnā€™t help.

I just canā€™t find the file where i should change the data. Maybe someone knows?

See
http://www.jsmackin.co.uk/suitecrm/suitecrm-list-view-conditional-formatting/

That is about changing the formatting, but you can also change the content.

Thanks for your answer!
Donā€™t you know is it possible to change it in listviewdefs.php file? I have problems with logic hooks, they are yet difficult for me :frowning:

Logic hooks are your friends, you shouldnā€™t fear them : - )

The post I linked is so detailed and simple that you canā€™t possibly get it wrong.

There IS an alternative technique: overriding the preDisplay method of the ListView. But that works only with Listviews, not with Subpanels, and that is quite a limitationā€¦

Thanks for your answer :slight_smile:

Well, the diffulculties for me are when i get to making class and functionā€¦i literally donā€™t know how to code it to get what i want :frowning:

You can also do this in metadata/listviewdefs.

For that fields add ā€˜customCodeā€™ => Whatever html you want

ie
ā€˜customCodeā€™ => ā€˜{$fields.first_name.value} {$fields.last_name.value}ā€™,

1 Like

Thanks for your answer!
Tried to do this way, but it becomes blank at all, so even no first and last names.

1 Like

It worked partly:
ā€˜customCodeā€™ => ā€™ {$LAST_NAME} {$FIRST_NAME} {$LIS_FATHERNAME_C} ',

But the problem is that i donā€™t know what to write in a ā€˜recordā€™ partā€¦ Is there any way to define every recordā€™s id?

1 Like

how do we add the if condition in the listview def

Hello @bhavin0070 . You should first overwrite the view.list.php file for the module. There are quite a few examples on how to do this. In the display override function you can set a variable in PHP and assign it to the like below.

$this->lv->ss->assign('VARIABLE_NAME', $php_variable); 

Then you can use the $VARIABLE_NAME in the listview def. You may need to double check my variable settings in the override but this should be the gist of how to do it.