legacy-knowledge-base
公開されました 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

learn-legacy-article-disclaimer-text

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