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)

Associate Many To Many

(0) ShareShare
ReportReport
Posted on by

I would like to associate Records on a Many to Many using Early bound. 

The following is an example of how i achieved the association for 1:N, i now want it for N:N.

if (results.Entities.Count > 0)
foreach (var Risklines in results.Entities)
{
acs_riskassessment rsklines = Risklines.ToEntity<acs_riskassessment>();
rsklines.fabric_quote = QuoteReference;
service.Update(Risklines);

}
}

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Sreevalli Profile Picture
    3,264 on at

    Hi,

    see the sample code for associate,

    Relationship relationship2 = new Relationship("account_primary_contact");  

    EntityReferenceCollection relatedEntities = new EntityReferenceCollection();  

    relatedEntities.Add(new EntityReference(Account.EntityLogicalName, firstaccount.Id));  

    _serviceProxy.Associate(Contact.EntityLogicalName, firstcontact.Id, relationship2, relatedEntities);  

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

    never personally used early bound with N:N association.

    But here is what i found on documentation : docs.microsoft.com/.../use-early-bound-entity-classes-associate-records    

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)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans