Change variable "full_name" from [first_name last_name] " to [first_name | last_name]

Hello everyone.

I want to change the variable ‘full_name’ throughout the entire suiteCRM.

I could only find one place where this was defined and that was in /custom/include/SugarObjects/templates/person/vardefs.php

Here I found:

    'full_name' => array(
        'name' => 'full_name',
        'rname' => 'full_name',
        'vname' => 'LBL_NAME',
        'type' => 'fullname',
        'fields' => array('first_name', 'last_name'),

It looks like the ‘fields’ is an example of what is creating the ‘first_name’, ‘last_name’ variable of full_name.

So I want to change this to:

    'fields' => array('first_name', | 'last_name'),

As an example. I know this is not the location that actually changes this system wide but it is what I want to do.

I want everywhere you see ‘full_name’ displayed in lists, or detail views, etc. to show “first_name, | 'last_name”

how can I accomplish this?

Please state your version of SuiteCRM, always.

Your syntax is wrong, you can’t just add a | there. Even if you got it inside the apostrophe, it wouldn’t work because that is an array definition, it’s not output formatting.

You need to change not when that array of fields is defined, but when that information is output - which happens in many places in the code. I don’t think it’s very easy to achieve if you don’t know much PHP.

Thanks pgr.

My version is: Sugar Version 6.5.25 (Build 344)

You are correct, I don’t know PHP at all. I’m a sys admin but that doesnt help much :slight_smile: I understand what you are saying about the array and played around and got what I wanted but only in one view:

‘fields’ => array (
0 => ‘first_name’,
1 => '|  ',
2 => ‘last_name’,

Basically I thought that possibly this ‘full_name’ was a site wide variable array that was defined somewhere and if I changed it in this one place it would carry over to all others.

Is this true? Like how does SuiteCRM know that every time ‘full_name’ is used that the system should add salutation, first name, last name, ? Where is this site wide array defined?



That’s an array of field names, not an array of strings that you can concatenate.

Exactly on which view do you want it changed?

I want it changed everywhere you see leads. So if I am looking at a list of meetings or calls and one of the columns is ‘full_name’ I want that to show up with this format. Or if I am viewing a Lead or a list of leads I always want this format. Anytime the system would put ‘first’ + ‘last’ name together I want to add the | in between.

I can’t find a single place in the code to change that.

So you will have to go into each view that uses those fields and change by hand. Different screens will pose different challenges. I think you will discover it isn’t worth the trouble… but good luck.

No problem. I appreciate you looking into it PGR.