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,154 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.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans