Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to set report filter

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

I want to set the report filters, below code i have used in cust ledger entry predataitem but i cant get the correct value please help me on this one.

CustLedgerpostings - OnPreDataItem()
SETRANGE("Posting Date",Date2,Date1);
SETRANGE("Date Filter",Date2,Date1);
SETRANGE("Entry No.",DetailedCustomerLedgerEntry."Cust. Ledger Entry No.");

CustLedgerpostings - OnAfterGetRecord()
DetailedCustomerLedgerEntry.RESET;
PostingAmount2 := 0;
REPEAT
DetailedCustomerLedgerEntry.RESET;
DetailedCustomerLedgerEntry.SETRANGE("Cust. Ledger Entry No.",PostedEntries."Entry No.");
DetailedCustomerLedgerEntry.SETRANGE("Posting Date",Date2,Date1);
IF DetailedCustomerLedgerEntry.FINDSET THEN
BEGIN
REPEAT
//PostedEntries.CALCFIELDS("Remaining Amount");
PostingAmount2 += DetailedCustomerLedgerEntry.Amount;
// MESSAGE('%1',PostingAmount2);
UNTIL DetailedCustomerLedgerEntry.NEXT= 0;
END;
UNTIL PostedEntries.NEXT= 0;

 

but last filter is not applying SETRANGE("Entry No.",DetailedCustomerLedgerEntry."Cust. Ledger Entry No.");  

please tell me i can i give filter from DetailedCustomerLedgerEntry table to custledger entry predataitem 

8272.Capture.PNG

Thanks & Regards,

Ashwini.E

*This post is locked for comments

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: How to set report filter

    You've not posted the report dataset structure here, so it's quite difficult to imagine what you have done.

    Are you sure that in OnPreDataItem you have a value for DetailedCustomerLedgerEntry."Cust. Ledger Entry No."? You can have that only if CustLedgerpostings  is an indented dataitem related to DetailedCustomerLedgerEntry.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,141 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,881 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans