web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

how to fetch record from N:N relationship

(0) ShareShare
ReportReport
Posted on by 80

Hi All,

I achieved multi-select functionality using standard N:N relationship, using the following link - https://crmtipoftheday.com/47/simple-multi-select-lists-in-crm-2013/

but how can I fetch the record which is associated with a particular record in the subgrid? For example, If I have Contact --> Language N:N relationship so having Subgrid for language on the Contact form, how can I fetch contact which is speaking Language "French" ?? 

In advance find, I didn't find Language in related entity list while querying contact. How can I write a query expression to fetch the required records?

Thanks

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Pawar Pravin Profile Picture
    5,237 on at

    Hi Shubh_K,

    Are you want to get languages in C#(plugin) or in JS?

    You can use advance find and fetchxml (intersect entity) to retrieve contacts which is speaking language as "French"

    Refer below case for reference:

    In my case I'm trying to retrieve users who is having system admin role.

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">

    <entity name="systemuser">

    <attribute name="fullname" />

    <attribute name="businessunitid" />

    <attribute name="title" />

    <attribute name="address1_telephone1" />

    <attribute name="positionid" />

    <attribute name="systemuserid" />

    <order attribute="fullname" descending="false" />

    <link-entity name="systemuserroles" from="systemuserid" to="systemuserid" visible="false" intersect="true">

    <link-entity name="role" from="roleid" to="roleid" alias="ae">

    <filter type="and">

    <condition attribute="name" operator="eq" value="System Administrator" />

    </filter>

    </link-entity>

    </link-entity>

    </entity>

    </fetch>

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at
  • Suggested answer
    Sreevalli Profile Picture
    3,264 on at

    Hi,

    you can do it form advancefind - Hi,

    You can fetch it from CRM advancefind - [View:https://www.crmsoftwareblog.com/2015/05/querying-many-many-relationships-microsoft-dynamics-crm/:750:50]

    if you are looking for C#


    Fetching contracts associated to Opportuntity QueryExpression query = new QueryExpression("ccseq_opportunity_ccseq_contract"); //relationshipname query.ColumnSet.AddColumns("contractid", "opportunityid"); query.Criteria = new FilterExpression(); query.Criteria.AddCondition("opportunityid", ConditionOperator.Equal, wonOpportunity.Id); //particular opp guid EntityCollection contracts = service.RetrieveMultiple(query);


  • Rajesh Chungath Profile Picture
    467 on at

    In many to many relationship configuration set "Display Option" to Use custom label and set a custom label for Language .

    Also please set searchable is to yes

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans