Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Many-to-Many relationships from activity entity?

(0) ShareShare
ReportReport
Posted on by 1,135

Hi!

I created a custom activity entity and I would like to add a N:N relationship to Products but I can not do this. Any ideas how to add the relationship? My aim is to "show" and "link" service products with activities so that the customer can calculate what the activites costs and how many products (services) they have accomplished.

One possibility that I found out is to create the manual N:N relationship, but I suppose it requires a lot more work? Any other ideas?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Many-to-Many relationships from activity entity?

    Folks:

    I need help with a similar kind of problem. We have these 2 entities:

    Account

    Strategy

    Each Account falls under a specific Strategy/ Strategies.

    eg:

               ABC Inc. falls under Strategies Core, Inflation, Tax

               XYZ Inc. falls under Strategies Bonds, Core

       PQR Inc. falls under Strategies Income, Inflation

    There is no support for multi-select pick list in CRM so using the solution listed here (crmtipoftheday.com/.../simple-multi-select-lists-in-crm-2013) I was able to create sub-grid (N:N relationship) to add multiple select and it works great.

    The next part is that we also want to know when a marketer has a Appointment Activity to list what all strategy / strategies the meeting was about? The Appointment activity does not allow N:N relationship so what will be the other alternative so that I can add multi select to appointment form?

    Thanks !

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Many-to-Many relationships from activity entity?

    My business scenario requires the user to associate the products to a phone call, when a end user calls and discuss about the products.

    I have created an custom entity and gave a 1:N relationship between phone call and custom entity and product and custom entity.

    Now I have lookup fileds for both product and phone cal on my custom entity form.

    I now need to display a product subgrid on phone call which displays the related products discussed

    Please help me how to proceed

  • mscrmba Profile Picture
    mscrmba on at
    RE: Many-to-Many relationships from activity entity?

    Ferdinand - you cannot add a party list to OOTB Activities (unless you use lots of code).

    What you can do is add a custom entity called Customers at Appointment / Appointment Parties (or similar).

    Add a lookup to Contact, and a lookup to Account, and a lookup to Appointment.

    Then add a sub-grid on Appointment for 'Customers at Appointment'

    The issue with doing this is that these interactions will not show in the OOTB list of activities/social pane for the Accounts or Contacts (as that is built based on Activity Party fields).

    I'm not sure what the best way of meeting your object fully is.  Someone else may have some ideas (e.g. with code is it possible to stop Appointments created in CRM sending appointment-related emails to people listed e.g. as optional attendees for an appointment).

  • mscrmba Profile Picture
    mscrmba on at
    RE: Many-to-Many relationships from activity entity?

    JP,

    Manual N:N relationship is what to do.  It is not difficult.

    Create an intersect entity called e.g. Service Activity Cost.  Go to Settings>Customizations>Components>Entities>New.  Give the entity a name. You may want to make the primary field optional for this entity (if so you need to do this before you save the new entity)

    Then go into the form view for Service Activity Cost and add a new lookup field for each of the activity types that you want to be able to record time against (e.g. Service Activity)

    Then add a lookup to Product/Service.

    Then go into Service Activity (or the other activity types) and add a sub-grid of Service Activity Costs

    If you want to load cost/time on more than one activity type you'll need separate sub-grids for each (or a custom iFrame to bring these records together into a single grid).

    Let us know if you have any issues.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Many-to-Many relationships from activity entity?

    Hello,

    I do have nearly the same problem. I have to solve the problem to add accounts and contacts to an appointment (standard activity) but to make sure that they are never will be contacted by Outlook!

    I do not find a way to add the field "customers" as a fieldtype Party List to the appointment activity

    Is ther an other way?

    Best Regards

    Ferdinand

  • mscrmba Profile Picture
    mscrmba on at
    RE: Many-to-Many relationships from activity entity?

    Great.  Best of luck.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Many-to-Many relationships from activity entity?

    Yes Perfect

    I was tyring to create new fields.

    Thanks for your patients.

  • mscrmba Profile Picture
    mscrmba on at
    RE: Many-to-Many relationships from activity entity?

    You need a Custom Activity of type Visit - set up like this (although you can Name it 'Visit' rather than 'Custom Activity 1'): 

    Party-list.PNG

    That is all you need.

    You then need to use one of the party list fields to capture who you spoke to on that visit.  They each behave a little differently - some let you select Contacts and Accounts, others let you select resources and users etc. Have a bit of a play and find the one that works best for the situation you're dealing with.  The fields already exist - just put them all on the form and have a play to see what they all do.  Customers or Outsource Vendors are likely to be good options.  Change the Display Name and Label for this field to something like 'Contacts Visited' and that should do everything you need.

    Let us know if you need any further assistance.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Many-to-Many relationships from activity entity?

    So far we have  1 visit  to multiple contacts at the one site. So I would like to record multiple contacts in the one activity record "Visit".

    We have program officers go to an Organisation and interact with many contacts at the one organisation, they then need to record the interaction in one activity.

    This works fine for one visit. But if they try to create a second visit and record activity with the same contacts the problem occurs.

    I am tyring to replicate what happens in the email party field without the need to create/send email.

    Your reference to visit several contacts, is just what I am after. but I cannot see how to

  • mscrmba Profile Picture
    mscrmba on at
    RE: Many-to-Many relationships from activity entity?

    Can you talk me through what you do at a business level?

    You have a Contact

    You make multiple visits (activities) to them

    So far we have 1 Contact : N Visits.

    What is the other entity and what data is it recording?

    Not to muddy the waters - but you do know that you can attach an activity into several activity parties using the special activity party fields (available only on Activity entities) (e.g. send an email to several people, visit several contacts)?

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

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,401 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans