I can't find a solution myself. I want to search for contacts, who are working in a special industry, but the industry is stored in the account. Any solution for that?
I can't find a solution myself. I want to search for contacts, who are working in a special industry, but the industry is stored in the account. Any solution for that?
Hi Dirk,
There would be two solutions to be able to do this:
a. Create a new field in the Contacts module which has the following Calculated formula:
related($accounts,"industry")
Then add this field to as a Search option for the Contacts module from within Studio. When viewing the List View of the Contacts module, the newly created field should be available as a filter option.
* please note that you will need to Recalculate values for all Contacts initially to allow this to work.
b. Create a Report based on the Contacts module which has a Run-time filter based on Contact >> Account >> Industry. You can then add the required fields for the report and then choose the required industry when viewing the report.
Hope this helps.
-Chris
Hi Dirk,
There would be two solutions to be able to do this:
a. Create a new field in the Contacts module which has the following Calculated formula:
related($accounts,"industry")
Then add this field to as a Search option for the Contacts module from within Studio. When viewing the List View of the Contacts module, the newly created field should be available as a filter option.
* please note that you will need to Recalculate values for all Contacts initially to allow this to work.
b. Create a Report based on the Contacts module which has a Run-time filter based on Contact >> Account >> Industry. You can then add the required fields for the report and then choose the required industry when viewing the report.
Hope this helps.
-Chris
Hello Chris,
Thank you for fast answering. I should have said that I'm using Version 6.5.16 (Build 1082) of sugarcrm, the community edition. So I didn't find a way to use your suggested solution. Is there a way to do it similar?
regards,
Dirk
Dirk,
You should be able to accomplish this by adding the following code-level customizations (3 files in total):
1. In the file:
./custom/modules/Contacts/metadata/SearchFields.php
add:
'account_industry' => array ( 'query_type' => 'default', 'db_field' => array ( 0 => 'accounts.industry', ), ),
2. In the file:
./custom/modules/Contacts/metadata/searchdefs.php
add:
'account_industry' => array ( 'name' => 'account_industry', 'label' => 'LBL_ACCOUNT_INDUSTRY', 'default' => true, 'width' => '10%', ),
3. In the file (create it if needed):
./custom/modules/Contacts/language/en_us.lang.php
add:
<?php // created: 2016-04-25 18:21:22 $mod_strings = array ( 'LBL_ACCOUNT_INDUSTRY' => 'Industry',
(Only add line 4 if you already have this file created)
4. Run a Quick Repair & Rebuild in Admin > Repairs.
5. You should now have this field available in the Contact Search layout and be able to search on it.
Hope this helps,
Lori