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 CRM (Archived)

How to remove the custom filter added to a lookup?

(0) ShareShare
ReportReport
Posted on by

We have a scenario where in we need to dynamically set a custom filter to a lookup but the problem is that when we add a new custom filter the previous filter stays on the lookup. Is there a way on how to remove the previously added custom filter on a lookup? Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rajkumar Rajaraman Profile Picture
    on at

    Hello,

    You can  try to follow the instructions from the below mentioned link:-

    inogic.com/.../add-custom-view-in-lookup-and-disable-all-the-other-views

    Hope this helps.

    Regards,

    R.Rajkumar

    "Please mark my answer as verified if you found it helpful"

  • ScottDurow Profile Picture
    21 on at

    You simply need to set the filter each time the lookup is opened in the presearch event. If there is no filter then don't set it. There is no way of removing the filter once added in any given presearch event.

    Hope this helps.

  • Suggested answer
    Jharana Baliyar Singh Profile Picture
    2,667 on at

    Hi,

    If i am not wrong you can disable the other filter which one you don't want to get.

    Please see the link below:

    community.dynamics.com/.../add-custom-view-in-lookup-and-disable-all-the-other-views

    Hope you might be get any solution!!

    Thanks

  • Community Member Profile Picture
    on at

    Hello Rajkumar,

    Thank you for your reply but we are not adding a custom view instead we are adding a filter on the current view.

  • Community Member Profile Picture
    on at

    Hi Scott,

    What we are currently trying to implement is a dynamic filter on Many to Many relationship subgrid, that whenever a user add/remove a record on a subgrid (Subgrid 1 lets say) we retrieve all the related record (account lets say). Then on the 2nd subgrid only the related record to subgrid 1 should display and we were able to accomplish this via addCustomFilter. Now the problem is if there are 2 records on the subgrid 1, and we remove one of the record (record 2) lets say, the previous filter for record 2 still stays on the lookup but should be removed.

    Is there a way to refresh a lookup? By that we are hoping that the customFilter added will get removed.

    We have some more days before the demo :s

  • Community Member Profile Picture
    on at

    Hi Jharana,

    Thanks for the response but we are not adding a custom view but instead using addCustomFilter. But we are thinking of if resetting the view of the lookup will remove its custom filter? We will try this tomorrow.  Thanks :)

  • Community Member Profile Picture
    on at

    Up...

  • ScottDurow Profile Picture
    21 on at

    The addcustomfilter method only works in lookup fields and does not work on sub grids. To implement a filter on a subgrid you will need to create a custom webresources using html. Do you really mean subgrid as in a grid added to a form?

  • Community Member Profile Picture
    on at

    Hi Scott,

    What we are filtering is the look up on the sub-grid. We added a JavaScript that runs on click of + on the sub-grid then access the sub-grid lookup and add custom filter to that lookup.

  • Community Member Profile Picture
    on at

    Hi Scott,

    Even though you've spoken about removing the filter, I still have some hope for possible workaround.

    Let me introduce you to my specific case. Phone Call form: filter Call From/Call To field based on Regarding object, depending on Direction.

    I am currently using .addPreSearch with .addCustomFilter to filter out Call To on outgoing call. On changing the Direction to incoming, the filter does its magic again and sets on the Call From lookup field. Unfortunately, Call To still remains filtered.

    I have tried using .removePreSearch or overriding this saved custom filter with other XML filter. No luck so far.

    Is there anything worth trying in order to achieve this kind of behavior in my case?

    Cheers,

    Łukasz

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans