I created a relate field in my custom module to pick a Contacts item:
The value from the Contacts module display: First_name Last_Name
Only in this case, I need to display the value of a custom fields from the Contacts module.
How can I do that? changing the vardefs? logic hook?
Create a new file at custom/Extension/application/Ext/Language/en_us.relatefields.php with the entries for the relate fields.
example
$app_list_strings['parent_type_display']['Receipts'] = 'Receipts';
Quick Repair & Rebuild
I can’t changed in the global extension because I have more then one relate fields from the Contacts module and it’s only in this case that I need to display another value.
Also, the value that I need to display in my relate field is a custom field saved in contacts_cstm table.
I think you may have to add a new field with a property ‘rname’ => ‘custom_field_name’, ‘module’=>‘Contacts’ in custom/Extension/modules/YourModule/Ext/Vardefs/fieldrelate.php file.
Add this field in detailviewdefs.php at custom/modules/YourModule/metadata/detailviewdefs.php in the panel row where you want to display.
Quick Repair & Rebuild.
Do you have an example of what I need to put into the
I saw that it was possible to do it in the doc, but there was no example
What are Vardefs The Vardefs are used to supply information to SuiteCRM about a particular bean. These generally specify the fields, relationships and indexes in a given module as well as additional information such as whether it is audited, the...
Do I put only this?
<?php
$dictionary["DestinationModule"]["fields"]["fieldrelate"]['module'] = 'Contacts';
$dictionary["DestinationModule"]["fields"]["fieldrelate"]['rname'] = 'contactsCustomField_c';
?>
Or I need to put something like:
<?php
$dictionary["DestinationModule"]["fields"]["fieldrelate"] = array (
'name' => 'fieldrelate',
'type' => 'relate',
'source' => 'non-db',
'module' => 'Contacts',
'rname' => 'contactsCustomField_c',
'comment' => 'Related field from Module Contacts',
other fields need??
);
?>
In the custom/Extension/modules/YourModule/Ext/Vardefs/fieldrelate.php
file, you need to put the below:
<?php
$dictionary["DestinationModule"]["fields"]["fieldrelate"]['module'] = 'Contacts';
$dictionary["DestinationModule"]["fields"]["fieldrelate"]['rname'] = 'contactsCustomField_c';
?>
Maybe it missing something, because now I have undefined instead of displaying the default firstName lastName :
Here what I have:
In the Contacts module, I created the custom field
In the new module, I created the relate field
I created a new file as discussed in this post: custom/Extension/modules/newModule/Ext/Vardefs/employeur3_c.php
Can you check if the following works?
Add the following entry
$dictionary["DestinationModule"]["fields"]["fieldrelate"]['id_name'] = 'contact_id';