Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Sample code or relationship for case to contact.

Posted on by

can anyone help me in getting the case record registered against a contact or customer.

i need to know relationship between case and contact , what will be the best approach to achieve this.

*This post is locked for comments

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Sample code or relationship for case to contact.

    There is a contact field in the case entity. Once you set that field, you should be able to see the list of cases in the Contact record.

    In the contact record, click on the arrow next to the Contact name, and select cases. This will list the cases that are related to the Contact. If you need you can add that as a subgrid to the Contact form.

    If you need to set the contact programmatically, you will need to specify the value of the primarycontactid field on the case entity:

    case["primarycontactid"] = new EntityReference(contactId, "contact");

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sample code or relationship for case to contact.

    Hi!  

    Are you sure that you need contact or customer? Contact is a kind of customer, and the customer can be a contact or an account. Maybe the contact or account?

    Hope this helps

     

    Vlad

    dynamicalabs.com

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sample code or relationship for case to contact.

    Hi,

    for Case:

    n:1 relationship: contact_as_primary_contact, contact_as_responsible_contact

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans