99% of the time I use the same coding patterns, and same commands, same data types … but once in a while you find something new and wonder. Hmmm, if Microsoft developed it, and use it in Base App, it might prove useful.
That brings me to the other day, when I’ve got a ticket related to Dimension Corrections. Then, by looking at the Base App code I stumbled upon a Data Type that I couldn’t recall using.
Meet FilterPageBuilder data type. It is used by the Add By Filter action.

In the documentation I found this:
FilterPageBuilder : “Stores filter configurations for a filter page. A filter page is a dynamic page type that contains one or more filter controls that enables users to set filters on fields of the underlying tables.”
In layman terms, if you want to collect at runtime a filter for any entity in BC you can use FilterPageBuilder. Then, with the filter values extracted from this helper page, we can find the records, and build whatever we need. Now, there is a more elegant way of achieving this with Navigate page, but using FilterPageBuilder is a quick and dirty tool that does the job.
Take, for example, this use case:
We are on Item Card, and we launch Item Availability By Location action.
We see low levels of inventory for some items /locations.
Wouldn’t be cool if we could create a Purchase Order, for that item, for a specific vendor (if Vendor No.” on item card does not work), and desired Quantity, from that page?

pageextension 50111 "SVItems by Location Matrix" extends "Items by Location Matrix"
{
actions
{
addafter("&Item Availability by")
{
action(PurchaseItemByLocation)
{
...
begin
title := 'Choose Location';
location.Reset();
FilterLocationPageBuilder.AddRecord(title, location);
if FilterLocationPageBuilder.RunModal() then begin
location.SetView(FilterLocationPageBuilder.GetView(title));
if location.FindFirst() then
LocationCode := location.Code;
....
I’m using 2 FilterPageBuilder variables to collect the location and the quantity desired from user, the item is known since the underlying page is based on Item record. With these ingredients known, we can start cooking a purchase order and post it.
If you want to watch how I’ve done it, step by step, here is the video:
Thanks for watching and subscribing!


