Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Custom filtering in grids

(1) ShareShare
ReportReport
Posted on by
Hello,
I have a scenario in which I have added a FormComboBox control to filter in a grid.
I have added a logic in the Modified method of the control to clear and add range whenever the user is changing the control value.
I then made the form data source execute query call.
However, I have noticed that if ever I have manually added a range on another field via the form UI (i.e. right clicking on the grid field value and used the UI to apply a filter), then the said range is being cleared when I change the combo control value.
Example of my scenario. The table is a TSTProductTable. The combo control is filtering on ProductType field. If ever the user manually filters on the ProductId, then the filter on the productId needs to be applied whenever the control value changes.
Is there any way to do it such that any other manually applied filter is still being applied?
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,379 Most Valuable Professional on at
    Custom filtering in grids
    It seems that you delete all ranges in your code. Stop doing it if you don't want it.
     
    Instead of clearing all ranges, you may want to use findOrCreateRange() for your field. If a range exists, you'll change its value, instead of removing the range and creating a new one.
     
    The safest solution is deleting all ranges for the field, because there could be more than one. But it's questionable whether you need this more complex approach.

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,379 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans