Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Filter Records

(0) ShareShare
ReportReport
Posted on by 3,099

Hi

  I want to filter records in Purchase Order <= Posting Date Filter in Report.

Thanks

     

*This post is locked for comments

  • Verified answer
    Tina Menezes Profile Picture
    2,582 on at
    RE: Filter Records

    Hi,

    You can define your start date initially if required. Then you need to write the below setfilter code.

    PurchaseHeader.SETFILTER("Posting Date", '<=%1', StartDate);

  • Suggested answer
    Marcellus Profile Picture
    2,735 on at
    RE: Filter Records

    Hello,

    Use SETFILTER:

    StartDate := 01072017D;

    "Purchase Header".SETFILTER("Posting Date", '..%1', StartDate);

    This will produce this filter: "..01/07/2017".

    Check the Enter Criteria Filters on MSDN: msdn.microsoft.com/.../hh879066(v=nav.90).aspx

  • jsshivalik Profile Picture
    3,099 on at
    RE: Filter Records

    Hi

       How to filter Posting Date as <= StartDate . Start Date is a variable.

    Thanks

  • Marcellus Profile Picture
    2,735 on at
    RE: Filter Records

    HI Jsshivalik,

    This image?

    5432.DataItemProperties.png

    In the ReqFilterFields field you can select fields from the table. More info about ReqFilterFields on MSDN: https://msdn.microsoft.com/en-us/dynamics-nav/reqfilterfields-property

  • Suggested answer
    Binesh Profile Picture
    7,885 on at
    RE: Filter Records

    Hello, if you have a development Environment then Open the Purchase Header Table ID [38]  and add bellow code in function "SetSecurityFilterOnRespCenter"

    2017_2D00_07_2D00_01_5F00_16_2D00_04_2D00_54.png

  • jsshivalik Profile Picture
    3,099 on at
    RE: Filter Records

    Hi

      Can u show the first image complete . I want Posting Date <= DateFrom

    Thanks

  • Suggested answer
    Marcellus Profile Picture
    2,735 on at
    RE: Filter Records

    Hi Jsshivalik,

    If you are using the Purchase Header as a data item you can add the Posting Date field in the ReqFilterFields property for example:

    DataItemProperties.png

    When the users run the report, they don't have to manually add the field to the filters, they can just type in a filter like the below:

    5270.RequestPage.png

    If you would like to handle this in your C/AL code, add a Global Variable with type Date and add it to a field on the request page.

     Then you can add a SETFILTER to your PurchaseHeader - OnPreDataItem
    SETFILTER("Posting Date", '%1..', DateFrom);

    In this case you can also default the value of the date variable to TODAY or WORKDATE.

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 Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans