Problem Statement –
In SugarCRM (version 6.5.15), audit module shows ID and not the value for related field.
Applicable to: SugarCRM 6.5.15 Community Edition
Is upgrade-safe?: No
Type: Bug fix
Bug ID: 33036
Solution –
Example: Enable audit on currency field in SugarCRM 6.5.15 and display field value instead of ID in the ‘View Change Log’ pop-up
Steps –
- Open the modules\Audit\field_assoc.php file
- Add this code snippet under $genericAssocFieldsArray
‘currency_id’ =>
array(‘table_name’ => ‘currencies’,
‘select_field_name’ => ‘iso4217’,
‘select_field_join’ => ‘id’,
),
- Final code should look like this –
$genericAssocFieldsArray = array(‘assigned_user_id’ =>
array(‘table_name’ => ‘users’,
‘select_field_name’ => ‘user_name’,
‘select_field_join’ => ‘id’,
),
‘account_id’ =>
array(‘table_name’ => ‘accounts’,
‘select_field_name’ => ‘name’,
‘select_field_join’ => ‘id’,
),
‘contact_id’ =>
array(‘table_name’ => ‘contacts’,
‘select_field_name’ =>
array(‘first_name’,
‘last_name’,
),
‘select_field_join’ => ‘id’,
),
‘fixed_in_release’ =>
array(‘table_name’ => ‘releases’,
‘select_field_name’ => ‘name’,
‘select_field_join’ => ‘id’,
),
‘found_in_release’ =>
array(‘table_name’ => ‘releases’,
‘select_field_name’ => ‘name’,
‘select_field_join’ => ‘id’,
),
‘currency_id’ =>
array(‘table_name’ => ‘currencies’,
‘select_field_name’ => ‘iso4217’,
‘select_field_join’ => ‘id’,
),
);
- Do Repair & Rebuild.
P.S.: This fix is not upgrade safe. It will break after upgrading SugarCRM.
It would ideally be fixed by SugarCRM in their future releases.