I created a new module that has a many-to-one relationship with Contact. This module is intended to record the office visits for a contact.
In the Office Visit list view, I would like to display additional fields from the contact for example, birthdate. The list view is already displaying the concatenated contact name along with fields from the Office Visit table but I cannot figure out how to add additional contact fields.
I am using SugarCRM 6.5.24 (CE)
My module is called HBF01_Initial_Exam
I added birthdate to custom/extension/modules/HBF01_Initial_Exam/Ext/Vardefs/hbf01_initial_exam_contacts_1_HBF01_Initial_Exam.php
<?php
// created: 2017-02-28 16:02:29
$dictionary["HBF01_Initial_Exam"]["fields"]["hbf01_initial_exam_contacts_1"] = array (
'name' => 'hbf01_initial_exam_contacts_1',
'type' => 'link',
'relationship' => 'hbf01_initial_exam_contacts_1',
'source' => 'non-db',
'module' => 'Contacts',
'bean_name' => 'Contact',
'vname' => 'LBL_HBF01_INITIAL_EXAM_CONTACTS_1_FROM_CONTACTS_TITLE',
'id_name' => 'hbf01_initial_exam_contacts_1contacts_ida',
);
$dictionary["HBF01_Initial_Exam"]["fields"]["hbf01_initial_exam_contacts_name"] = array (
'name' => 'hbf01_initial_exam_contacts_name',
'type' => 'relate',
'source' => 'non-db',
'vname' => 'LBL_HBF01_INITIAL_EXAM_CONTACTS_1_FROM_CONTACTS_TITLE',
'save' => true,
'id_name' => 'hbf01_initial_exam_contacts_1contacts_ida',
'link' => 'hbf01_initial_exam_contacts_1',
'table' => 'contacts',
'module' => 'Contacts',
'rname' => 'name',
'db_concat_fields' =>
array (
0 => 'first_name',
1 => 'last_name'
),
);
$dictionary["HBF01_Initial_Exam"]["fields"]["birthdate"] = array (
'name' => 'birthdate',
'type' => 'date',
'source' => 'non-db',
);
$dictionary["HBF01_Initial_Exam"]["fields"]["hbf01_initial_exam_contacts_1contacts_ida"] = array (
'name' => 'hbf01_initial_exam_contacts_1contacts_ida',
'type' => 'link',
'relationship' => 'hbf01_initial_exam_contacts_1',
'source' => 'non-db',
'reportable' => false,
'side' => 'right',
'vname' => 'LBL_HBF01_INITIAL_EXAM_CONTACTS_1_FROM_INITIAL_EXAM_TITLE',
);
I also tried adding birthdate to htdocs/modules/HBF01_Initial_EXAM/vardefs.php. The label is added to the list view but the data is always empty.
This is what I see in the SugarCRM.log
07/08/17 18:39:55 [5188][1][DEBUG] Limit Query: SELECT hbf01_initial_exam.id ,hbf01_initial_exam_cstm.appt_ttime_c,hbf01_initial_exam_cstm.arrival_time_c,
AND jt0.deleted=0 where hbf01_initial_exam.deleted=0 ORDER BY birthdate ASC Start: 0 count: 21
Your help is greatly appreciated.