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 :
Customer experience | Sales, Customer Insights,...
Unanswered

Use Custom filtered lookup/view

(0) ShareShare
ReportReport
Posted on by 5

Hoping someone can help me out with this...

I have a parent entity with a grid that show child related records. On that grid there is a button to add existing records OOTB.

What I would like to do is filter the lookup/view that pops up so that the resulting records are filtered to only related records determined by some filter criteria.

I believe I have the correct filter using fetchxml however other methods I have tried have not worked. For example, I have tried the addCustomView function but it doesnt seem like it works in this instance. 

If anyone has done something similar successfully in the past or anyone with ideas or solutions, it will be greatly appreciated.

I have been stuck on this for a couple of days now and would like to get it resolved as soon as I can . 

Thank you

I have the same question (0)
  • meelamri Profile Picture
    13,216 User Group Leader on at

    Hello,

    Can you share your Code please ?

    Mehdi,

  • Duane Wayne Profile Picture
    5 on at

    Hi Mehdi, thank you for the quick response.

    Some one directed me to some literature that helped me figure out what I needed to do to resolve my issue. I have a working solution now. Thanks

  • Abby Kong Profile Picture
    6 on at

    Hi Duane,

    Is the grid for N to N relationship?

    If yes, addCustomView function does not apply here. You might need to look at using Xrm.Unitility.lookupObjects to achieve this:

    www.magnetismsolutions.com/.../filter-n-n-add-existing-lookup-dynamics-365-v9-supported-code

    Regards,

    Abby

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    You need to use JS and Ribbon Work bench to do this.

    1.Use JS code to do custom filter in lookup view in gird.

    2.Trigger the JS method in subgrid add existing ribbon.

    Here is the link for steps.

    https://www.magnetismsolutions.com/blog/paulnieuwelaar/2018/05/17/filter-n-n-add-existing-lookup-dynamics-365-v9-supported-code

    https://crm365blog.wordpress.com/2018/06/17/filtering-lookup-on-adding-related-records-in-sub-grid/

    Best Regards,

    Leo

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 81 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans