D365 Business Central : Selection Filter Management

Ever heard of SelectionFilterManagement codeunit ? It’s a centralized codeunit that is used to built up filter string based on multiple selected records on the page.
An example of usage of SelectionFilterManagement codeunit can be seen on G/L Account Card under Totaling field. When you click on Assist Edit button on Totaling field, the G/L Account List lookup page will appear, you then select multiple records and click OK. The lookup page will return the filter string in the Totaling field. Nice.

So how do we implement this ? You first need to create GetSelectionFilter() procedure under your lookup page. Below is the example from G/L Account List page.

After that, you just need to call the GetSelectionFilter procedure after returning LookupOK from the lookup page. Pretty straightforward.

The SelectionFilterManagement codeunit supports some important tables, such as Customer, Vendor, Item, Resource, GL Account, etc. You can also use RecordRef as well.

No need to use SetSelectionFilter and looping through the records again.
1 Response
[…] Selection Filter Management […]