Legacy Knowledge Base
Published Jun. 30, 2025

Is it possible to filter the Account Selector search results to exclude fields?

Written By

Madeleine Clay

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • I would like to add a filter to the Account Selector fragment so that it excludes selected matching fields from the search results.
  • For example, I would like to exclude any results with Account IDs that match the numbers that I'm searching, so that I only get Account Names that include the number strings.

Environment

  •  Commerce

Resolution

  • Unfortunately, it's not possible to filter Account Selector results at this time.

Additional Information

  • We have an open feature request at LPD-33145 to explore the option of adding filters to the Account Selector fragment.

NOTE: The following resolution requires customization and should only be implemented at the discretion of your team. Liferay Support will not be able to assist with designing or implementing customizations.

  • In the meantime, it may be possible to customize the account selector by overriding

    the AccountResourceImpl class with another component that, in the pre-filter of the getChannelAccountsPage method, add another filter to booleanQuery like this:

if (Validator.isNotNull(search)) {
PrefixFilter prefixFilter = new PrefixFilter("accountEntryId", search);

    booleanQuery.getPreBooleanFilter().add(prefixFilter, BooleanClauseOccur.MUST_NOT);
}
  • In this way, the accounts that have the id equal to the search term will be filtered out.
Did this article resolve your issue ?

Legacy Knowledge Base