Friday, 27 June 2014

Filter records based on parent module's dropdown field in SugarCRM7.

Filter records based on parent module's dropdown field in SugarCRM7.For example, filter the Contacts module record on the Accounts module's Industry field. Please look at attached screenshot.

(1) create file at custom/Extension/modules/Contacts/Ext/Vardefs/accountIndustryType.php and write the following code into it.

$dictionary['Contact']['fields']['account_industry_type'] = array (
'name' => 'account_industry_type',
'source'=>'non-db',
'massupdate' => false,
'type' =>'enum',
'options' => 'industry_dom'
);

(2) Write the following code into custom\modules\Contacts\language\en_us.lang.php

$mod_strings['LBL_ACCOUNT_INDUSTRY_TYPE'] = 'Account Industry Type';

(3) write the following code into fields array of custom/modules/Contacts/clients/base/filters/default/default.php file
'account_industry_type' => array (
'dbFields' =>
array (
0 => 'accounts.industry',
),
'type' => 'enum',
'vname' => 'LBL_ACCOUNT_INDUSTRY_TYPE',
),

(4) Do "Quick Repair and Rebuild".

(5) Open Contacts ListView and search on Accounts Industry Type.




Urdhva Tech Pvt. Ltd. Powered by Blogger.

Urdhva Tech

My Photo
SugarCRM Consultants Contact us at contact@urdhva-tech.com Skype : urdhvatech

Search This Blog

Loading...

Stay connected Socially

     

Total Pageviews

Popular Posts