Set Filters and Sorting for Lookup Records
Last updated
Was this helpful?
Last updated
Was this helpful?
x`Configure filters to load specific records of the lookup object that meet defined conditions, and set sorting options to arrange the records in the desired order when the Lookup Selector screen loads.
Filters ensure that only records meeting the specified conditions are displayed when the Lookup Selector is loaded. The filter configuration follows the syntax of a SOQL WHERE clause.
For example, to display only active PricebookEntry records, you can write:
Additionally, you can use the Query Wizard to automatically generate filters without manually writing them.
To use a parent object field value in a filter, bind it using the syntax {$Parent.FieldName}.
For instance, to display only records with the same currency as the parent object, you can write the filter as:
CurrencyIsoCode = {$Parent.CurrencyIsoCode}
This dynamically references the parent object's currency field, ensuring relevant records are retrieved.
Sorting ensures that the data appears in the desired order when the Lookup Selector screen loads. The sorting configuration follows the syntax of a SOQL ORDER BY clause.
For example, to sort PricebookEntry records by name in ascending order, you can write: