web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Using FilterPageBuilder to filter records as an input to a query - is it possible

(0) ShareShare
ReportReport
Posted on by 8
Hi Experts,
 
I am extracting data from Posted Sales Invoices (Headers & Lines) that is displayed on a page so the users can then extract out to Excel.
 
I have set up a query that outputs to a temp file and built a new page that displays only specific fields. This all works fine.
 
What I would like to do now is filter the data based on user entered data on opening of the page, eg a range of invoice numbers, and only have this filtered data be used by the query and then output on the page. I have attempted to use FilterPageBuilder on a Page Extension of the new Page to achieve this but I am getting a /table ids do not match/ error.
 
Is what I am trying to do achievable?
 
Below is the code I have written and thanks in advance
Stephen
 
pageextension 50110 InvoiceforWarehouseFilePageExt extends /Posted Sales Invoices/
{
actions
{
addafter(/&Invoice/)
{
action(/Invoices for Warehouse File List/)
{
Caption = 'Invoices for Warehouse File';
ApplicationArea = All;
Promoted = true;
PromotedCategory = Process;
PromotedIsBig = true;
 
trigger OnAction()
var
varFilterPageBuilder: FilterPageBuilder;
PostedInvoiceList: Record /Sales Invoice Header/;
begin
varFilterPageBuilder.AddRecord('Sales Invoice Header Table', PostedInvoiceList);
varFilterPageBuilder.Addfield('Sales Invoice Header Table', PostedInvoiceList./No./);
varFilterPageBuilder.PageCaption := 'Posted Invoices for Warehouse Filter Page';
if varFilterPageBuilder.RunModal() then begin
PostedInvoiceList.SetView(varFilterPageBuilder.GetView('Sales Invoice Header Table'));
//Page.Run(Page::/InvoicesforWarehouseFilePage/, PostedInvoiceList);
Page.Run(50100);
end;
end;
}
}
}
}
 
page 50100 /InvoicesforWarehouseFilePage/
{
Caption = 'Invoices for Warehouse File';
PageType = List;
UsageCategory = Lists;
ApplicationArea = All;
SourceTable = /InvoicesforWarehouseFileTemp/;
Editable = false;
 
layout
{
area(Content)
{
repeater(Group)
{
field(/Order Number/; Rec./DocumentNo/)
{
ApplicationArea = All;
}
field(/Ship-to-Name/; Rec./Ship-to-Name/)
{
ApplicationArea = All;
}
field(/Customer PO/; Rec./External Document No/)
{
ApplicationArea = All;
}
field(/Address 1/; Rec./Ship-to Address/)
{
ApplicationArea = All;
}
field(/Address 2/; Rec./Ship-to Address 2/)
{
ApplicationArea = All;
}
field(/Address 3/; Rec./Ship-to Address 3/)
{
ApplicationArea = All;
}
field(/Suburb/; Rec./Ship-to City/)
{
ApplicationArea = All;
}
field(/State/; Rec./Ship-to County/)
{
ApplicationArea = All;
}
field(/Postcode/; Rec./Ship-to Post Code/)
{
ApplicationArea = All;
}
field(/Contact/; Rec./Sell-to Contact/)
{
ApplicationArea = All;
}
field(/Phone/; Rec./Sell-to Phone No./)
{
ApplicationArea = All;
}
field(/Contact Email/; Rec./Sell-to E-Mail/)
{
ApplicationArea = All;
}
field(/Instructions/; Rec./Shipping Instructions/)
{
ApplicationArea = All;
}
field(/Carrier/; Rec./Shipment Method Code/)
{
ApplicationArea = All;
}
 
field(/Product Code/; Rec./Product Code/)
{
ApplicationArea = All;
}
field(/Quantity/; Rec./Quantity/)
{
ApplicationArea = All;
}
 
}
}
}
trigger OnOpenPage()
var
InvoicesforWarehouseFileQuery: Query InvoicesforWarehouseFileQuery;
begin
CurrPage.Editable(false);
if InvoicesforWarehouseFileQuery.Open() then begin
while InvoicesforWarehouseFileQuery.Read()
do begin
Rec.Init();
Rec.RowNo := Rec.RowNo + 1;
Rec.DocumentNo := InvoicesforWarehouseFileQuery.DocumentNo;
Rec./External Document No/ := InvoicesforWarehouseFileQuery.External_Document_No_;
Rec./Ship-to-Name/ := InvoicesforWarehouseFileQuery.ShiptoName;
Rec./Ship-to Address/ := InvoicesforWarehouseFileQuery.ShiptoAddress;
Rec./Ship-to Address 2/ := InvoicesforWarehouseFileQuery.ShiptoAddress2;
Rec./Ship-to Address 3/ := InvoicesforWarehouseFileQuery.ShiptoAddress3;
Rec./Ship-to City/ := InvoicesforWarehouseFileQuery.ShiptoCity;
Rec./Ship-to County/ := InvoicesforWarehouseFileQuery.ShiptoCounty;
Rec./Ship-to Post Code/ := InvoicesforWarehouseFileQuery.ShiptoPostCode;
Rec./Sell-to Contact/ := InvoicesforWarehouseFileQuery.SelltoContact;
Rec./Sell-to Phone No./ := InvoicesforWarehouseFileQuery.SelltoPhoneNo;
Rec./Sell-to E-Mail/ := InvoicesforWarehouseFileQuery.SelltoEMail;
Rec./Shipping Instructions/ := InvoicesforWarehouseFileQuery.Shipping_Instructions;
Rec./Shipment Method Code/ := InvoicesforWarehouseFileQuery.ShipmentMethodCode;
Rec./Product Code/ := InvoicesforWarehouseFileQuery.No_;
Rec./Quantity/ := InvoicesforWarehouseFileQuery.Quantity;
Rec.Insert()
end;
InvoicesforWarehouseFileQuery.Close();
end;
end;
}
I have the same question (0)
  • Verified answer
    YUN ZHU Profile Picture
    95,763 Super User 2025 Season 2 on at
    Hi, as far as I know this can't be done. Only tables can be added.
    So it is recommended to create a report to do it.
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Community member Profile Picture
    8 on at
    Many thanks ZHU,
     
    I was hoping there may have been a way to use the temp table containing the Invoice(s) number that my FilterPageBuilder creates and then use these to filter on the query to restrict the records. Perhaps an idea for further research / development at a later time :)
     
    Cheers
    Stephen

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans