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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

1:N relationship

(0) ShareShare
ReportReport
Posted on by

Hi,

I have this scenario where i need to include products and prices on new leads, and here is what i did:

1. created new entity new_PRODUCTS with 2 fields: new_CODE, new_NAME

2. Uploaded products data from csv template

3. Add 1:N relationship to the Lead set as primary and new_Products set as related entity

4. I then added a sub-grid onto the lead form to display sub products

My objective is to be able to add products on the lead in this manner:

Product code(new_Products), Competitor Name (Accounts entity), Competitor Price(manually entered currency data field)

Not sure what the best approach to this would be. do i need to create a 1:N new_Products to Accounts ? and how to go about the price ?

Thanks in advance :)

WB

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    If you create a 1:N relationship of new product with account then one product will be attached with one account only. I think this is not what you would want because once you have used it, you wont be able to use same product with any other account. So either you can create a N:N relationship between the account and new product OR you can create a intermediate entity to store lead lookup, new product lookup and account lookup on the form.

    Hope this helps

  • Community Member Profile Picture
    on at

    Thanks Vikas,

    I understand the relational structure, just not sure how to incorporate that as a sub-grid on the lead form. Your suggestion is to have two lookups and a currency field. how can this be added to a sub entity ?

    Thanks :)

    WB

  • Verified answer
    Sean Michel Profile Picture
    340 on at

    Hi WissamB,

    To create the structure Vikas suggests, you'll need to create an intersecting entity (a new entity entirely) that holds a lookup to the Product, lookup to the Account, and lookup to the Lead. This is one method to create a "manual" many to many. It will serve as an intersection between the entities.

    Then, you could put a subgrid of the intersecting entity itself on the Account, Lead, and/or Product entities. This would allow you to see many related Products from Accounts and many related Accounts from Products, etc.

    The benefit to this method is that you can store additional information about the intersecting Account, Product, and Lead on the intersecting entity.

    The alternative Vikas suggests, is an out of box many to many. To do this, you can navigate to Account inside Customize the System. From there, choose N:N and create a new relationship between Account and Product. Make sure to set the display option as either a custom label, or use plural name.

    Then, you can insert a subgrid that shows this N:N relationship (choose your custom label or plural name that you set before) on both the Account and Product entity.

    However, if you need to see Accouts and Products on one grid on the Lead entity, you'll want to go with Option 1, probably.

    Here is a video walkthrough of a manual many to many (my first explanation above)

    [View:https://community.dynamics.com/crm/b/crmvideos/archive/2012/05/23/many-to-many-relationships-of-the-manual-kind]

    And a video on out of box N:N

    Hope it helps!

  • Community Member Profile Picture
    on at

    Thanks Sean,

    So I did create a new entity and added 2 lookups for products and accounts, my intention was to link the same data once a lead is qualified to entity. so what i did, rather then adding the lead look up to the new entity, I added a 1:N to lead entity.

    i Then added the sub grid on the lead form, when I test adding a new record it takes me to another screen with Name field only! I was looking to have an in-line search box similar to competitor sub grid and is it possible to remove the name field

    Much appreciated :)

  • Suggested answer
    Sean Michel Profile Picture
    340 on at

    Ah! So a few things:

    1. I'm assuming when you test adding a new record it takes you to the new Intersecting Entity you just created, right? Showing only the Name field?

    You'll need to customize that form to put on the appropriate fields that you created (look-ups, currency).

    Then, you'll need to customize the VIEW that the sub-grid uses on the Lead for this Intersecting Entity, to display the fields (look-ups + currency, etc) on the sub grid itself.

    You can certainly remove the Name field from this record as well. You'll have to make it "not required" first.

    Again, this will have to occur on the Intersecting Entity record you created (Settings > Customizations > Customize the System > Your Intersecting Entity > Forms > Information > Do your customizations.

    2. Since you are creating an Intersecting Entity, you'll have to create the Intersecting Entity record each time you add it to the Lead. This means a new record will open up, like you are experiencing now.

    Then, once the record opens, you will have to fill out the Competitor (Account) in the look-up you created, and can look-up Product in the product look-up you created.

    First, as per #1, you'll have to add this to the Intersecting Entity form, of course.

    Then, once you save the record, it will show up on the sub-grid in the Lead record, displaying the associated Product and associated Competitor that you have filled in. You can create as many of these intersections as you want, allows for multiple Product/Competitor combinations to multiple Lead records.

    As you can see, it functions a little different than the in-line search box of the out of box N:N or 1:N relationships. That said, it allows for you to add a more robust intersection, and store data about the intersection.

    If you need to add a Competitor (Account) each time that a Product is added to a Lead, this is really the only route you'll have.

    There are other options if instead, you were OK with adding a list of Competitors that are associated to the Products (Multiple Competitors to Multiple Products).

    If that is OK for your requirement, you could implement an out of box N:N between Account and Product, and associate the Account's with Products as needed.

    From there, you could add an out of box N:N between Product and Lead, adding a sub-grid of Products to the Lead record, using the N:N relationship.

    The downside of this approach is that to see the related Competitors (accounts), you'd have to click into the Product record itself, and would not be able to see it just from the sub-grid.

    Let me know if that makes sense!

  • Community Member Profile Picture
    on at

    makes perfect sense, thanks, Except for the name field which apparently is a primary field by default. it can be set to optional but cannot be removed out of the form. It has a padlock sign and when I click remove it says the field is required by business or system. Now I assume I can create a 1:N relation on the opportunity appropriate field and this should carry the added records to opportunity 

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans