Solved

CRM RetrieveMultiple web service

Posted on 2010-11-29
4
949 Views
Last Modified: 2012-06-27
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?

0
Comment
Question by:mortimer452
4 Comments
 
LVL 29

Accepted Solution

by:
Feridun Kadir earned 500 total points
ID: 34231578
Did you investigate using a QueryExpression with a LinkEntity?
0
 
LVL 29

Expert Comment

by:Kumaraswamy R
ID: 34238299
0
 
LVL 8

Expert Comment

by:edemcs
ID: 34238845
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

0
 
LVL 3

Author Closing Comment

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

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question