A way that I know to display fields from related modules is like in this exemple:
Create a file named: custom/Extension/modules/<MODULE_NAME>/Ext/Vardefs/<ANY_NAME>.php, then input some code like that:
PHP Code:
<?php
$dictionary["Account"]["fields"]["contact_office_phone"] = array (
'name' => 'contact_office_phone',
'type' => 'relate',
'source' => 'non-db',
'rname' => '<REPLACE_THE_FIELD_NAME_OF_CONTACT_MODULE>', // phone_work
'id_name' => '<REPLACE_YOUR_RELATE_FIELD_NAME>', // in my case, contact_id_c
'vname' => 'LBL_CONTACT_OFFICE_PHONE', // change appropriate label and put the label in language file
'type' => 'relate',
'link'=> 'contacts_link',
'table' => 'contacts',
'isnull' => 'true',
'module' => 'Contacts',
'dbType' => 'varchar',
);
$dictionary["Account"]["fields"]["contacts_link"] =
array (
'name' => 'contacts',
'type' => 'link',
'relationship' => 'accounts_contacts_rel',
'module'=>'Contacts',
'bean_name'=>'Contact',
'source'=>'non-db',
'vname'=>'LBL_CONTACTS',
);
$dictionary["Account"]["relationships"]["accounts_contacts_rel"] = // make sure relationship name is unique
array('lhs_module'=> 'Contacts', 'lhs_table'=> 'contacts', 'lhs_key' => 'id',
'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts_cstm', 'rhs_key' => '<REPLACE_YOUR_RELATE_FIELD_NAME>', // in my case, contact_id_c
'relationship_type'=>'one-to-many');
Then you can repeat this for each custo field which you want to display. In this code exemple, the field that goes to be displayed in layouts is "contact_office_phone". May you can try this adapting for your case.
Bookmarks