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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Mapping in Native N:N relationship

(0) ShareShare
ReportReport
Posted on by 1,055

Hi, I have 2 custom entities which are connected with native N:N relationship. Can I map datas from the one entity to another, if yes how?

 

 

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Muhammad Adeel Javaid Profile Picture
    5,580 on at
    RE: Mapping in Native N:N relationship

    The functionality you are inquiring about is available out of the box for N:1 relationships, but not for N:N relationships.  You just map the fields under the properties for the relationship and then when you create a new entity from the parent entity in the relationship, the fields will automatically be mapped over.

    The only way you could probably do this with N:N would be to use custom code as part of a plugin.

  • Suggested answer
    Muhammad Adeel Javaid Profile Picture
    5,580 on at
    RE: Mapping in Native N:N relationship

    You can create the code using xrm (you dont have to, you can hardcode entity names).

    Get the relationship by using:

    EntityReference target = (EntityReference context.InputParameters["Target"];

    and

    Relationship relationship = (Relationship)context.InputParameters["Relationship"];<br/>EntityReferenceCollection relatedIdentities = (EntityReferenceCollection)context.InputParameters["RelatedEntities"];

    Register the plugin using the Asscociate method - with no primary or secondary entity. You will have to make sure that find the right entities and relationship so your code doesnt run for all relationships made.

    You can also refer to the below mentioned link:

    www.magnetism.co.nz/.../Associate_Disassociate_Message_for_Dynamics_CRM_2011_Plug-ins.aspx

  • AFTAB HUSSAIN Profile Picture
    on at
    RE: Mapping in Native N:N relationship

    Hello Mark,

    Please see the link below. See if this helps.

    community.dynamics.com/.../107164.aspx

    Thank You !

  • Balaji Karpurapu Profile Picture
    193 on at
    RE: Mapping in Native N:N relationship

    Hi Muhammad, I have below requirement in one of my project . Can you please provide your suggestion to achieve it.

    I have three entity's like Account, Contact and Engagement (Custom Entity) and Account is lookup field in engagement entity. Created N:N relationship between contact and engagement and placed as subgrid with contact columns view in Engagement. When use click on click "+" from grid it open's contact quick create and user will provide necessary data then click on ok it will create record in contact subgrid . the problem here is on Quick Create I have Account lookup it's should be auto populate with the value. how do we do field mapping in N:N relation in my scenario

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans