Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer Service forum

Filter on Add Existing Entity Look up on Sub grid

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

HI Team,

Greetings!!

i would like to inform you that i am facing some issue i loading the filter entity records in the add existing popup of subgrid which is mapped to an entity.

Description:

we have three entities

Customer Entity (1 : N relation with Sites)

Sites Entity (N :1 relation with customer)

Project Entity (1:1 relation with Customer and 1: N relation with Sites)

 so now open the project entity form where we have 

General Tab and Sites tab.

in general tab we have customer lookup feild and in sites tab subgrid we have "Add Existing Button" on right top corner.

so when i select a customer in look up feild Under General tab in project entity and save.

then moved to site tab where when i click on "Add Existing Item" and search on Sites it is displaying all the Sites . But it should show only the related sites for the customer selected.

can you please help.

Tscreen1.PNGscreen2.PNGscreen3.pnghanks and Regards

Ravikiran G

Categories:
  • Suggested answer
    RE: Filter on Add Existing Entity Look up on Sub grid

    Ravikiran,

    We are also experiencing similar situation in our project --> Filter a Subgrid based on a lookup (In your case, you want to filter Sites Based on Customer Selected.)

    Firstly, This is not possible OOTB. You have to write a JS to filter the Subgrid, I am afraid there is no supported way to do it.

    Solution which we are following ( Totally OOTB with no custom code) --> You can create a middle entity ( Between Project and Sites , call it ProjectSites ?)  ( Project -1:N -ProjectSite -N:1- Site)

    This means ProjectSite will have -->

    1. Lookup for Project

    2. Lookup for Site

    3. Add another Lookup for Customer

    4. On the ProjectSite form, add these three lookups. Configure the site to show only the related records with Customer Lookup

    5. On the Project Form, add subgrid for ProjectSites ( Remove the subgrid for Sites)

    Working --> When you open Project record --> Click Add new ProjectSite --> On the Project Site Form, Project will be Pre-Selected , customer will be Pre-Selected (By adding field mapping from Project.Customer to ProjectSite.Customer) and the lookup for Sites will be filtered based on Customer. <-- This is replicating your Add Existing Site functionality, but in a different supported and OOTB way (Without any code)

    Hope this helps :)

    Do connect with me if you want any other info regarding this scenario.

  • LeoAlt Profile Picture
    LeoAlt 16,331 on at
    RE: Filter on Add Existing Entity Look up on Sub grid

    Good day partner,

    First of all, OOB functions of Dynamics 365 only support that  Sites sub grid could only show all records or records related to the main entity(Project).

    So if you want to filter the sub grid according to lookup field(customer), you should use some js code to do this.

    Here are some samples for your reference.

    https://bernado-nguyen-hoan.com/2017/01/06/apply-filtering-to-subgrids-inline-lookup-in-crm/

    https://social.microsoft.com/Forums/en-US/56a804a1-bfbb-4998-bb06-7e16afb6724d/filtering-subgrid-from-lookup-value?forum=crmdevelopment

    https://community.dynamics.com/crm/f/117/t/258470

    Hope it helps.

    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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans