Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

How to Get all the account name associated with particular contact ??

Posted on by Microsoft Employee

 have a contact  'Maree Test' which having two account associate with it-

1. "Al Joaib Furniture Factory" and

2. " Waiau Pa school "

When i'm getting JSON data from the CRM WebAPI I can see only first account name that is " Al Joaib Furniture Factory". Is there any way to get all the account name for the particular contact ? 4024.2017_2D00_07_2D00_13_5F00_1658.png

*This post is locked for comments

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: How to Get all the account name associated with particular contact ??

    The best option for you would be to download the CRM Rest Builder and build/run the queries/requests on demand. Its easy to use.

    github.com/.../CRMRESTBuilder

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: How to Get all the account name associated with particular contact ??

    Actually, it's the same query Ravi posted..

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: How to Get all the account name associated with particular contact ??

    If you want all contacts which have parent customer set to a specific account, here is the query:

    .../api/data/v8.2/contacts?$select=firstname&$filter=parentcustomerid_account/accountid%20eq%20475B158C-541C-E511-80D3-3863BB347BA8

    BUT that grid you have highlighted is using some sort of relationship which won't work with this request.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to Get all the account name associated with particular contact ??

    @AlexShlega both would be fine. I am not able to query both.

    All contacts under an account

    or

    All accounts under a contact.

    Thank You

    Joy

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: How to Get all the account name associated with particular contact ??

    this should work

    ---

    https:// <your org>/api/data/v8.2/contacts?$filter=_parentcustomerid_value%20eq%2083D1423A-0E63-E711-8146-E0071B684991

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: How to Get all the account name associated with particular contact ??

    Do you need all contacts or all accounts(as per the question in the title of this thread)??

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to Get all the account name associated with particular contact ??

    @RaviKashyap  I can query primaryContact from web api, But I need to query all the contacts under an account not only primaryContact

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to Get all the account name associated with particular contact ??

    Can you please let me know, how to query those contacts through web api.

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: How to Get all the account name associated with particular contact ??

    You could refer this request, you need to change the '_primarycontactid_value' with your field name

    https:// <your org>/api/data/v8.2/accounts?$filter=_primarycontactid_value%20eq%2083D1423A-0E63-E711-8146-E0071B684991

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to Get all the account name associated with particular contact ??

    I need to pull all contacts that are associated with an account through CRM Web api ?

    Right now I'm able to pull only primaryContact of an account, but I want to pull the contacts that are associated with an account.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

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