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

Announcements

News and Announcements icon
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? 

I have the same question (0)
  • Suggested answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    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

  • Suggested answer
    Community Member Profile Picture
    on at

    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
    Bipin D365 Profile Picture
    28,995 Moderator on at

    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
    CRMJetty Profile Picture
    3,514 on at

    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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 25 Most Valuable Professional

#3
Ayesha Wajahat Profile Picture

Ayesha Wajahat 16

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans