Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Create a custom filter for a page to be filtered

Posted on by 2,576

Hi all.

I want to create a custom field for Amount where users can enter for eg: >1000, <1000,>=1200, etc. and the page should filter and give the respective records like if >1000 is entered then only the records having amount >1000 are displayed. This is already present in standard nav tables as shown below:

table-filter-image.PNG

I want to do the same functionality  in my customized page. Can anyone suggest how this can be done?

*This post is locked for comments

  • Suggested answer
    Maneesha Profile Picture
    Maneesha 5,889 on at
    RE: Create a custom filter for a page to be filtered

    hi i have suggestion bu not sure if it is working for you or not

    How about using "Advance Filter' option to filter your requirement , then you can save it as your own

  • Verified answer
    mmv Profile Picture
    mmv 11,465 on at
    RE: Create a custom filter for a page to be filtered

    It works well.

    Try the below code:-

    CustLedgerEntryTable.SETFILTER("Remaining Amount","Balance due text");

  • Tina Menezes Profile Picture
    Tina Menezes 2,576 on at
    RE: Create a custom filter for a page to be filtered

    Hi,

    I have checked that. It is not working. I have created a text field 'Balance due text'. So the user will enter say >1000 as input for this field. Now with this input I want to filter customer ledger entries with 'Remaining Amount' > 1000. 'Balance due text' value can be anything like >10000, <=300000, <5000, etc. So if I enter the below expression in my code:

    CustLedgerEntryTable.SETFILTER("Remaining Amount",'%1',"Balance due text");

    The above line will give me error because Remaining amount is decimal field and Balance due text is text field. If I convert Balance due text to decimal using evaluate it again gives error because symbols like >,<,=, etc. cannot be converted to decimal. This is causing an issue and hence I am not able to filter values.

  • mmv Profile Picture
    mmv 11,465 on at
    RE: Create a custom filter for a page to be filtered

    You may define those fields as Text type.  And when you filter, you need to add an Inverted Comma (') on both the sides of the values.

    E.g: while filtering '>1000'

  • Tina Menezes Profile Picture
    Tina Menezes 2,576 on at
    RE: Create a custom filter for a page to be filtered

    Yes. The user will enter values like these and the records should get filtered and be displayed accordingly.

  • mmv Profile Picture
    mmv 11,465 on at
    RE: Create a custom filter for a page to be filtered

    Do you mean that the custom field will hold values like ">1000", ">=1200" etc.?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans