locked
Dynamics 365 - New Entities, Need Relationship assistance. RRS feed

  • Question

  • I have no idea what i'm doing so i need some help, I'm the only CRM person and i don't have much experience with creating relationships, workflows, processes etc...  Brand brand new to CRM but i do have Admin rights.

    Relationship Help Needed
    I have 2 New Entities I created.

    Entity: Subscription (won't list all field but main fields)
      Fields:  Account Name (lookup to Account)
      Fields:  Subscription name
      Fields:  Sub User Email IDs (lookup to Subscription User) (needs to be in Grid Layout since Subscription Name can have Multiple User Email Ids associated to it)

    Entity: Subscription User
      Fields:  Account Name (lookup to Account)
      Fields:  User Email ID: *Primary field
      Fields:  User First Name
      Fields:  User Last Name
      Fields:  Subscription Name (lookup to Subscription) (Need Grid Layout) since user can be associated to multiple subscriptions names

    With these 2 entities, i need to create a Relationship that will do what i hoping can be done.

    On the Subscription Entity i want to see List of "Sub User Email Ids" associated to the Given Subscription
    On the Subscription User Entity i want to see List of "Subscription Names" that this user is associated to in Subscription entity

    How would I exactly get this to happen, using Dynamics 365. 
    For what ever reason i just cannot get this to do what i want... Any help, suggestion would be greatly appreciated.

    Tuesday, June 27, 2017 9:44 PM

Answers

  • The one you defined is not N:N relationship. As soon as you give look-up, it turns to be 1:N relationship. between entity and field relation entity.

    You can create a N:N relationship between your existing entities this way.

    1. Remove your Lookup field for "Subscription Name" under Subscription user entity.

    2. Navigate to Customizations > Expand Subscription Entity > select N:N Relationships.

    3. Click on New Many-to-Many Relationship and add select Subscription User entity in Other entity section.

    4. Add sub-grids in both the entities referencing to other entity.

    You are all done, you can see related records in the grid, you can also add users by using + above the grid.


    Jugal Kishore Dandamudi.

    • Marked as answer by RobinRK Thursday, June 29, 2017 2:03 PM
    Thursday, June 29, 2017 12:00 PM

All replies

  • Hello Robin,

    With the configuration that you made, it is obvious that these are following 1:N relation ship from Subscription to Subscription User.

    1. On the Subscription Entity i want to see List of "Sub User Email Ids" associated to the Given Subscription

    For the above you can simply add a subgrid to the form with primary entity as subscription user and set the view to related records only.

    2. On the Subscription User Entity i want to see List of "Subscription Names" that this user is associated to in Subscription entity

    Since, it is 1:N relationship. At any point of time you can see only one subscription to user, which is visible in "Subscription Name" field.


    Jugal Kishore Dandamudi.

    Wednesday, June 28, 2017 5:21 AM
  • Would these not be N:N ?  - I'm sure I have something wrong somewhere....

    In Subscription Entity - a user can be associated to Multiple (different) subscriptions

    In Subscription User Entity - would need to list all Subscription the given user is associated to.

    I know when I try the 1:N I try to link a user to a 2nd subscription I get error stating User is already associated with another record.

    Subscription Entity:
    Subscription Name:  OFPDS-NB
        Sub User Email Id:   UserA
        Sub User Email Id:   UserB
        Sub User Email Id:   UserC

    Subscription Name:  OFPDS-IWS
        Sub User Email Id:   UserA
        Sub User Email Id:   UserM
        Sub User Email Id:   UserZ

    Subscription User Entity:
    USER EMAIL ID: UserA
     Subscription Name: OFPDS-NB
     Subscription Name: OFPDS-IWS

    But I do appreciate your response.

    Wednesday, June 28, 2017 2:12 PM
  • The one you defined is not N:N relationship. As soon as you give look-up, it turns to be 1:N relationship. between entity and field relation entity.

    You can create a N:N relationship between your existing entities this way.

    1. Remove your Lookup field for "Subscription Name" under Subscription user entity.

    2. Navigate to Customizations > Expand Subscription Entity > select N:N Relationships.

    3. Click on New Many-to-Many Relationship and add select Subscription User entity in Other entity section.

    4. Add sub-grids in both the entities referencing to other entity.

    You are all done, you can see related records in the grid, you can also add users by using + above the grid.


    Jugal Kishore Dandamudi.

    • Marked as answer by RobinRK Thursday, June 29, 2017 2:03 PM
    Thursday, June 29, 2017 12:00 PM
  • Thank you, I don't know why I was having such a hard time with this.  I guess one of my issues is I thought I had to have actual field in table to do the grid on. 

    But have I got everything cleaned up.  and followed your last steps I had no problem getting this to work. 

    Don't be surprise if you see another post from me out here as I have many unsolved issues I need assistance on.  THANK YOU AGAIN

    Thursday, June 29, 2017 2:07 PM
  • I just thought of one question to ask on how and or if this could be done.  On the Subscription User entity I have active Subscription users View.

    Once thing that would be nice to have which I know probably not possible since I have a subgrid pulling Subscription.

    In my View I would like to see a Subscription column that shows me the subscriptions a user is linked to, so that I can then Export that info when needed.

    Since I removed the Subscription Name field from the Subscription User entity and the Subscription info is pulled into a grid. not sure how to accomplish this.

    Thursday, June 29, 2017 3:44 PM
  • There are two possibilities to achieve this.

    1. Create SSRS report with the details that you need.

    https://www.simple-talk.com/sql/reporting-services/sql-server-reporting-services-basics-building-ssrs-reports/

    2. Create a plugin to trigger on associate, get all subscriptions and update the field with subscription names to that field.

    3. Create a javascript and do the same option 2, but will be on save of the form.

    Based on your requirement, I suggest option 2 or 3.


    Jugal Kishore Dandamudi.

    Friday, June 30, 2017 6:57 AM
  • Thank you once again, I think I might just forget this part, my experience level is my main issue.  Since I don't do javascript that option is out and when you say create a plugin, not sure what you mean by that.  

    But I do appreciate you taking the time to respond to my questions.

    • Marked as answer by RobinRK Thursday, July 6, 2017 1:41 PM
    • Unmarked as answer by RobinRK Thursday, July 6, 2017 1:41 PM
    Thursday, July 6, 2017 1:41 PM