Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Suggested answer

How to set report filter

Posted on by Microsoft Employee

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

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,160 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans