Link to home
Start Free TrialLog in
Avatar of mortimer452
mortimer452

asked on

CRM RetrieveMultiple web service

Good morning Experts,

I need to create a "Select contact" pop-up box on a customer's website that allows them to select a contact from their CRM database.  They are using Microsoft CRM 3.0, I'm developing in ASP.Net 2.0

I'm using the CRM web services .RetrieveMultiple method to do the search, user types in a contact name like "smith" and behind-the-scenes I'm building a CRM query to search for %SMITH% and display the results in a datagrid.

The problem is I'd like to display the account (company) name along with each contact.  When I execute the query I get back a BusinessEntityCollection containing all the contacts, and each contact has an AccountID property, but I can't figure out how to get the account name without retrieve the Account object for each AccountID.  

Is there any way to retrieve the first and last names of a Contact, along with their associated Account's name, in a single query?

ASKER CERTIFIED SOLUTION
Avatar of Feridun Kadir
Feridun Kadir
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
mortimer452,
In situations like these, I would suggest updating your BO to include the AccountName as a property without retrieving the entire account object.  You may think that the data is redundant because you'll get that same data when you retrieve the Account object, except, for your process it is more efficient to include the account name with the employee object instead of retrieving the entire object.  

1

Update your query for your employee object to include the account name

2. Update the employee object to also include the account name property

Avatar of mortimer452
mortimer452

ASKER

Thanks feridun, I'm pretty new to CRM and had no idea such a thing existed, that was exactly what I needed.