web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans