Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Custom filtering in grids
Finance forum
Answered

Custom filtering in grids

Posted on by 250
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 228,135 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.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,277 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans