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 :
Microsoft Dynamics NAV (Archived)

SetFilter

(0) ShareShare
ReportReport
Posted on by 3,099

Hi



ILE[2].SETRANGE("Posting Date",StartDate,EndDate);
ILE[2].SETFILTER(ILE[2]."Entry Type",'%1|%2',ILE[2]."Entry Type"::Consumption,ILE[2]."Consumption Type"::Rev);
ILE[2].SETFILTER(Quantity,'>%1',0);
IF ILE[2].FINDFIRST THEN REPEAT
  Qty[2] += ILE[2].Quantity;
  MESSAGE('%1',ILE[2]."Entry Type");
 UNTIL ILE[2].NEXT=0;

In message it is displaying +ve Adjustment , whereas i have filtered records on Entry Type "Consumption

Thanks

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Amol Salvi Profile Picture
    18,698 on at

    TRY this.

    ILE[2].SETRANGE("Posting Date",StartDate,EndDate);

    ILE[2].SETFILTER(ILE[2]."Entry Type",'%1',ILE[2]."Entry Type"::Consumption);

    ILE[2].SETFILTER(ILE[2]."Consumption Type",ILE[2]."Consumption Type"::Rev);

    ILE[2].SETFILTER(Quantity,'>%1',0);

    IF ILE[2].FINDFIRST THEN REPEAT

      Qty[2] += ILE[2].Quantity;

      MESSAGE('%1',ILE[2]."Entry Type");

     UNTIL ILE[2].NEXT=0;

  • ManishS Profile Picture
    86 on at

    ILE[2].SETFILTER(Quantity,'>%1',0); here you are filtering quantity greater than zero.

  • jsshivalik Profile Picture
    3,099 on at

    Hi

      That's ok.  But i want with Quantity  > 0 & also Entry Type should be Consumption or Rev

    Thanks

  • jsshivalik Profile Picture
    3,099 on at

    Hi

     Can u pls tell me what is wrong in that Code.

    Thanks

  • Verified answer
    Rafael B. Profile Picture
    715 on at

    Hi

    Take a look at this line:

    ILE[2].SETFILTER(ILE[2]."Entry Type",'%1|%2',ILE[2]."Entry Type"::Consumption,ILE[2]."Consumption Type"::Rev);

    You filter "Entry Type" field by option value from "Entry type" field (that's ok) and by option value from "Consumption Type" field (that's a mistake).

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
TAHER_El_Mehdi Profile Picture

TAHER_El_Mehdi 2

#1
sliderxb Profile Picture

sliderxb 2

#1
broberts Profile Picture

broberts 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans