How to set initial_filter in SuiteCRM 8.6?

Hello,
is it possible to set initial filter for search modal dialog that appearch when user clicks on arrow next to relate field?

i tried to use initial_filter:

'displayParams' => array (
        'initial_filter' => '&<field_name>=<value>',
    ),

but looks like this does not work in SuiteCRM 8+

this is what i am trying to achieve:


Hey @adam_2, welcome to the community!

This seems to be missing feature on SuiteCRM v8. It has already been raised on github.

Can we use the below artical for the initial filter

I just tried this out today on 8.9.2 Initial Filter definately does not work in SuiteCRM 8.

This:

'displayParams' => array (
		'initial_filter' => '&account_type_advanced=Vendor',
		),

or

'filter' => [
			'static' => [
				[
					'field' => 'account_type',
					'operator' => '=',
					'value' => 'Vendor'
				]
			]
		]

Also tried this:

'filter' => [
				'static' => [
					'account_type' => 'Vendor',
				],
			],

Basically what I want to do (and could do in SuiteCRM 7)

Without having it tested, that seems to be the logic around the default / selected target lists in the 8.9.x campaigns multi-related field.

for filtering related records in the MultiRelateEditFieldComponent

Thanks @BastianHammer thats the tutorial I was following. It doesn’t work.

Also there is no ā€œMultiRelateā€ field type, unless it’s strictly created by code. I assume they mean from a subpanel, not a relate type field. The documentation is really hard to understand.

Yes, the new field types are missing in the studio.
I’ve built them just via code and/or own modules to load them later on.

Hope this will be ā€œfixedā€ sooner or later, otherwise all the new features and usefulness is restricted to developers only and the target audience of SuiteCRM is shrinking quickly.

As for the documentation: it doesn’t lead to a solution of this topic, but in general - if you turn it around, don’t have a specific goal in mind and just start copying / tinkering the tutorials and then see the outcome, that often works.
It’s a different approach - not so much a guide to a specific solution but more sth. like getting to know what could be done with the system in general. Not always helpful and difficult to interprete / find use for.

This was a very useful developer feature in SuiteCRM 7. Hopefully, it will be added soon. Being able to filter the relate field popup is such a great feature for UI.

I had the exact same working in V7, and for now like you, impossible to make it work in V8. I’ve tried to edit the detailviewdef or editviewdef, for now I didnt find how to do this

1 Like

Hi @adam_2 , I ran into the same issue on SuiteCRM 8.6 and can confirm that initial_filter doesn’t work in the new (Angular) frontend popups. It seems this is still only supported in legacy (SuiteCRM 7-style) views.

As a workaround, I had some success using the newer filter option in field metadata, for example:

ā€˜filter’ => [
ā€˜static’ => [
ā€˜status’ => [ā€˜Active’]
]
]

This works for certain field types (like MultiRelate) in the v8 frontend, although it’s not a full replacement for initial_filter in popup selections.

For now, it looks like there’s no direct equivalent for setting an initial popup filter in SuiteCRM 8, so the options are either:

Use the filter metadata where applicable
Rely on saved/quick filters in the UI
Or implement a custom backend workaround (less ideal)

Would be great if this gets proper support in a future release.

1 Like