Setting Up Filters
In certain scenarios, it is necessary to configure additional filters to restrict the displayed data in Business Portals. This is particularly relevant when presenting customer-based data. Without appropriate filters, all data contained in the dataset would be displayed. To ensure that a logged-in user can only view their own data, a suitable filter must be set up. The filter establishes the link between the logged-in user in Business Portals and the corresponding records in Business Central. The filter configuration ensures that Business Portals only displays the records associated with the customer currently logged into Business Portals. This way, a correct and secure display of the data is guaranteed.
- Start as Business Portals Administrator in the Role Center.
- Navigate through the menu bar via Portal setup to your datasets.
- Select the dataset and open it by clicking on the active status or by clicking the three dots next to the Dataset Code.
- Navigate to the tables.
- Select a Dataset Table Code for which you want to Set up Filters.
- The previous setup must have already been completed; if this is not the case, find more information under Setting up the Dataset Table.
- Then click on Filter.
- Select the field to be filtered.
-
Choose a Type of filter from the following options:
-
CONST
The filter type CONST allows for a fixed filter on a predefined value. This filter type is only available for fields of type Option. During setup, a specific value is selected, which the records will be permanently filtered by.
A typical use case is the sales header, where the field Document Type is permanently set to Order using the CONST filter type. In this case, only records of this document type will be displayed.
-
FILTER
The filter type FILTER allows for dynamic filtering of records. One or more values can be selected, so multiple options can be displayed simultaneously. The selection can be flexibly adjusted and influences the amount of data displayed accordingly.
The filtering is based on the standard filtering mechanisms of Microsoft Dynamics 365 Business Central and allows for the selection of one or more values per field. For more information, see the official Microsoft documentation: Microsoft Learn
Note
If you want to filter in multiple ways, you must use the separator symbol |. For example: If you filter by Document Type and select the field filter Order|Invoice, then your configured dataset table will filter for orders and invoices.
-
USERMAPPING
The USERMAPPING filter type automatically filters records based on the logged-in user. This means that only data associated with the respective user is displayed.
-
DATEFORMULA
The DATEFORMULA filter type allows for time-based filtering of records based on a date field. It can filter either on a specific date or on predefined date formulas such as CD (Current Date) for the current day's date or CY (Current Year) for the current calendar year. This way, Business Portals will only display records whose date values fall within the defined time period.
Example
If the value -3M or CY is used for the field Order Date, only records will be displayed whose order date falls within the last three months or within the current calendar year.
-