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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Pre-define value for Filter

(0) ShareShare
ReportReport
Posted on by 50

Hi,

I want to display dynamically the predefined value of the customer number on the filter of the page Item Ledger Entries by an page extension from Customer Card.

I have done the button and the filter but i can't display my value.

It works when it's a static value.

Can someone help me ?

There is my code and some exemple of my issue.

trigger OnAction()

                var
                    varFilterPageBuilder: FilterPageBuilder;
                    ItemLedgerEntry: Record "Item Ledger Entry";
                    MyCustomer: Record Customer;
                begin
                    varFilterPageBuilder.AddTable('Ecriture Comptables Article Table', ItemLedgerEntry.RecordId.TableNo);
                    varFilterPageBuilder.AddFieldNo('Ecriture Comptables Article Table', ItemLedgerEntry.FieldNo("Source No."), MyCustomer."No.");
                    varFilterPageBuilder.PageCaption := 'Ecritures Comptables Article Filtre';
                    if varFilterPageBuilder.RunModal() then begin
                        ItemLedgerEntry.SetView(varFilterPageBuilder.GetView('Ecriture Comptables Article Table'));
                        Page.Run(Page::"Item Ledger Entries", ItemLedgerEntry);
                    end;
                end;

Result to: 2023_2D00_01_2D00_12-10_5F00_10_5F00_43_2D00_Modifier-_2D00_-Fiche-client-_2D00_-Dynamics-365-Business-Central-_1420_-Mozilla-Firefox.png

varFilterPageBuilder.AddFieldNo('Ecriture Comptables Article Table', ItemLedgerEntry.FieldNo("Source No."), 'Test');

But when we put static value it result to: 2023_2D00_01_2D00_12-10_5F00_10_5F00_21_2D00_Modifier-_2D00_-Fiche-client-_2D00_-Dynamics-365-Business-Central-_1420_-Mozilla-Firefox.png

And what I want to take is the Customer No from the page Customer Card.

2023_2D00_01_2D00_12-10_5F00_15_5F00_54_2D00_Modifier-_2D00_-Fiche-client-_2D00_-Dynamics-365-Business-Central-_1420_-Mozilla-Firefox.png

  • DAnny3211 Profile Picture
    11,423 Super User 2026 Season 1 on at

    hi

    look this

    https://yzhums.com/21007/

    DAniele

  • Nrims Profile Picture
    50 on at

    I have already check this, but I don't see anything that can help me :/

  • Verified answer
    Nrims Profile Picture
    50 on at

    It was simple..., I needed to put Rec."No." instead of MyCustomer."No."

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 796 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 481 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 377 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans