Skip to main content
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

N:N Relationship and Roll up field

(0) ShareShare
ReportReport
Posted on by 35

Hi. 

I have this scenario:

I have a N:N Relationship between account and a custom entity (Code). 

Question 1: I really need to calculate number of accounts for every given code. Roll up fields can't be used in N:N relationship. Is there another way to do it?

Question 2: How can I generate a list of accounts associated with several codes? 

  • Suggested answer
    CRMJetty Profile Picture
    3,512 on at
    RE: N:N Relationship and Roll up field

    Hello,

    pls refer this article,

     https://community.dynamics.com/365/sales/f/dynamics-365-for-sales-forum/290937/how-to-use-roll-up-field-for-n-n-relationship/834835 


    I hope it helps,

    Thanks.

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365

  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: N:N Relationship and Roll up field

    Hi,

    If you don't want to write plugin and still use OOB feature then I would recommend you creating custom N:N relationship between Account and Code.

    global.hitachi-solutions.com/.../custom-entities-n-n-relationships-dynamics-365-customer-engagement

    This way you will have control and should be able to add rollup fields too.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: N:N Relationship and Roll up field

    Hi Anna0326:

    Answer 1:

    Rollup fields can be used for 1:N relationship only, you can't use them for N:N relationship.

    You can register a plugin for the "Associate" message, or create another entity manually and build N:1 relationships with Account and Code, then you can use rollup field. 

    Field with count of relationship records. - Microsoft Dynamics CRM Forum Community Forum

    Answer 2:

    Using 'Advanced Find' to filter records:

    pastedimage1644982973883v5.png

    Select code entity under 'Related' tab:

    pastedimage1644983103529v7.png

    Click 'Results' to show list:

    pastedimage1644982950567v4.png

    pastedimage1644982992607v6.png

    Note:

    Make sure that the 'Display Option' is not 'Do Not Display', which affects whether the entity(Code) appears under 'Related' tab in 'Advanced Find'

    pastedimage1644982749977v2.png

  • Suggested answer
    Guido Preite Profile Picture
    54,082 Moderator on at
    RE: N:N Relationship and Roll up field

    1) you will need to write a plugin

    2) you should be able to create an OOB report (https://docs.microsoft.com/en-us/powerapps/user/create-report-with-wizard) to create the list you need

    hope it helps

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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#2
Ramesh Kumar Profile Picture

Ramesh Kumar 42

#3
David Shaw_UK Profile Picture

David Shaw_UK 27

Featured topics

Product updates

Dynamics 365 release plans