Skip to main content

Notifications

Announcements

No record found.

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

  • Verified answer
    Nrims Profile Picture
    Nrims 50 on at
    RE: Pre-define value for Filter

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

  • Nrims Profile Picture
    Nrims 50 on at
    RE: Pre-define value for Filter

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

  • DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: Pre-define value for Filter

    hi

    look this

    https://yzhums.com/21007/

    DAniele

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans