Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Getting Account details along with Contacts?

(0) ShareShare
ReportReport
Posted on by

Hello, I'm working on a C# app that access the user's Dynamics data.  In some cases I lookup Contacts and if those contacts have an Account Name (aka Company Name) set then I'd also like to get back the Account name and ID along with some Contact details.  I've got the lookup of the Contacts working fine but haven't been able to figure out if I can also get back the related Account info.  I'm using a QueryExpression to get back the Contacts along with RetrieveMultiple().  I believe that the relationship I'm interested in is the contact_customer_contacts but beyond that I'm clueless.  I tried forming up some kind of LinkEntitys but couldn't seem to get the lookup to work.

This seems like a pretty common needs so how do I do it?

Thanks!

*This post is locked for comments

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Getting Account details along with Contacts?

    Hi,

    You need to use Link entity (msdn.microsoft.com/.../microsoft.xrm.sdk.query.linkentity.aspx) to get related entity fields, you can use queryexpression or fetchxml for this. below are some of the threads which should help you

    msdn.microsoft.com/.../gg328149.aspx

    community.dynamics.com/.../140622

    msdynamicscrmblog.wordpress.com/.../get-fetch-xml-linked-entity-attributes-using-c-in-dynamics-crm-2011

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans