AnsweredAssumed Answered

How to enable sorting by the custom fullname field

Question asked by Pavla Medvecov√° on Jun 15, 2016

Hello,

 

We created a new fieldset (account_full_name) of three fields (first name, middle name and last name) and we added this field also into the record view and list view and everything works fine but there is a problem when a user wants to sort records in list view by this field (column). Then this error occurs: Non existing field: account_full_name in module: Accounts.

We extended the FullnameField in the module Accounts where we used this mapping in the custom fullname.js:

's': 'first_name_c',

'f': 'middle_name_c',

'l': 'last_name_c'

and we also copied all the hbs files without any changes.

 

Then we only added this field into the record view and list view:

array (

'name' => 'account_full_name',

'type' => 'fullname',

'label' => 'LBL_ACCOUNT_FULL_NAME',

'dismiss_label' => true,

'fields' =>

array (

0 => 'first_name_c',

1 => 'middle_name_c',

2 => 'last_name_c',

),

),

We also tried to add this field to the vardefs (like in the person/vardefs.php) but then we had problems with fetching the data.

Does anybody know where could be the problem and what is important to set to enable sorting by the full name?

 

Thanks,

Pavla M.

Outcomes