Nickname instead salutaion and fullname

Hello!

Is the possible to show in Layouts instead Full name with salutation, data from created in module Contacts text field (Nickname) if it is filled?

For example, if fields Firstname and Lastname filled, but also filled field Nickname than show everywhere in layouts Salutation + Nickame or if Nickname field not filled, show everywhere Salutation + Fistname + Lastname.

Thank you for answers.

Hi, you can modify the display of your detailviewdefs by JavaScript custom code by editing

custom/modules/Contacts/metadata/detailviewdefs.php

like this:


 array (
	'name' => 'full_name',
	'label' => 'LBL_NAME',
	'customCode' => '
                <script type="text/javascript">
                         if("{$fields.nickname_c.value}" != "")
                                 document.setElementById("full_name").value = "{$fields.salutation.value} {$fields.nickname_c.value}";
                 </script>',
1 Like

sorry,

setElementById

should be

getElementById
1 Like

Thank you very much for your answer. :wink:

Is your example really fit for my needs? Iā€™m attached few screens with comments. I need to change everywhere in SuiteCRM Fullname view to Nickname, if Nickname filled in contact form.

Please, excuse me for my English.

Thank you!