Filter contacts based on account property

Hello all!

I would like to filter all contact that are part of some specific account. Let’s say i want all contact that work for a specific type of business.

Anyway to do it with normal filters or by tweaking some stuff in studio or do i have to code some stuff ?

Thanks!
Pierre

I think filtering Contacts by their Account is part of the normal filters. But to filter by another Account field you might have to do some customizing.

In Studio you can make fields searchable. But if you require searching by fields in related modules (not in the module you’re searching), that will require (simple) code.

Try Googling for “suitecrm adding fields to list view filters” or similar… good luck.

Hi,

look here for an example:

https://suitecrm.com/forum/developer-help/4598-grab-fields-from-a-related-record-without-sugar-logic#17675

Look at the entry

 'rname' => 'employees',

Replace it with the field name you require, probably “account_type” or “industry”

After making the proposed changes and doing a repair and rebuild, your field should show up in studio under Contacts, so you can add it to your search layouts.

1 Like

Thanks for your quick reply… and sorry for my late one :wink:

It works somehow but not exactly as expected. Let me explain a bit better what i want to achieve :

I have some custom fields in the Account module (renamed to “Venues” as i’m dealing with venues for concerts and stuff). I added those fields :

  • Musical style (multi-select) (name : musical_style_c ; list : musical_style_list)
  • Venue type (multi-select) (name : venue_type_c ; list : venue_type_list)
  • Venue dates (multi-select) (name : venue_dates_c ; list : months_list
  • When to apply (multi-select) (name : venue_apply_dates_c ; list : months_list)

I would like to be able to filter all the contacts that are working in some specific venues. Lets say : all contacts working for a jazz festival in January.

To start, i did this to filter by venue type (i created a file called venue_type.php at that place : custom/Extension/modules/Contacts/Ext/Vardefs, i also created the proper language file for the label).

Here is want i did in my venue_type.php file :


$dictionary['Contact']['fields']['venue_type_c'] = array (
	'name' => 'venue_type_c',
	'id_name' => 'account_id',
	'type' => 'relate',
	'rname' => 'venue_type_c',
	'vname' => 'LBL_VENUE_TYPE',
	'link' => 'accounts',
	'module' => 'Accounts',
	'source' => 'non-db',
	'dbType' => 'non-db',
	'studio' => 'visible',
	'massupdate' => false,
);

How to make that work and to tell suiteCRM to display a multi-select box ?

Thanks!
Pierre