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 tobooleanQuery
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.
会員限定記事
Liferay エンタープライズ サブスクリプションをお持ちのお客様は1500件を超えるベストプラクティス、トラブルシューティング、その他のソリューション記事を閲覧できます。ログインすると、記事全体をお読みいただけます。
ログイン