Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

N:N relationship data/field/attribute mapping when creating record from subgrid

(0) ShareShare
ReportReport
Posted on by 35

I have an N:N relationship between entity Case & entity Contact and trying to do mapping between them for a required lookup field "Category", so that when I'm creating NEW Case record from the Case subgrid in Contact form, the lookup field "Category" is pre-filled/pre-populated with Case's Category value.  Since it can't be done with data mapping (only applicable to 1:N relationship), I'm looking for a way to do that with custom code, but fail to construct it since I can't think of a way to pull the parent record creating the NEW record. 

Anyone knows how to pull the parent record when creating new record from N:N subgrid?  Or any other way to accomplish the N:N attribute mapping purpose?

Thanks a lot in advance!

  • meelamri Profile Picture
    meelamri 13,212 User Group Leader on at
    RE: N:N relationship data/field/attribute mapping when creating record from subgrid

    I'm glad you figured it out with a little extra analysis.

  • Suggested answer
    danosagi_002 Profile Picture
    danosagi_002 35 on at
    RE: N:N relationship data/field/attribute mapping when creating record from subgrid

    Thanks for the timely reply.  In this blog it was describing the scenario having entity A & B as N:1 relationship, but having a 3rd entity/attribute (Bank) N:N linked to both entities A & B, then it's mapping from A to B (N:1) with N:N related data.  

    However my scenario is that having entity A & B as N:N relationship, and having 1:N linked to both entities A & B, then it's mapping from A to B (N:N) with just a lookup field (N:1) data.

    But this blog inspired me to look into how Lead, Account, Contact, Opportunity works and I found Lead having both N:1 & 1:N & N:N relationship with Account & Contact.  Therefore, I solved it by created another entity B/"Case" lookup field in entity A/"Contact" (which is a N:1 relationship from Contact to Case), simulating the "Originating Lead" field & relationship in the OOB Contact & Account.  Then the mapping works exactly what I want.  Thanks for the inspiration although it was not the direct answer.

  • Verified answer
    meelamri Profile Picture
    meelamri 13,212 User Group Leader on at
    RE: N:N relationship data/field/attribute mapping when creating record from subgrid

    Hi, 

    Please refer to this blog: 

    ashwaniashwin.wordpress.com/.../

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,436 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans