RetrieveMultiple Method

The RetrieveMultiple method gets one or more than one instance of an entity.

For example, you can use this method as shown in Listing 24.4 to retrieve all the Accounts for an organization.

LISTING 24.4 Retrieve an Organization’s Accounts

private static void GetAllAccounts(string organizationName)         {             using (XrmSdk.OrganizationServiceClient myCrm =  new XrmSdk. OrganizationServiceClient())             {                 try                 {                     myCrm.Endpoint.Address =               new System.ServiceModel.EndpointAddress               (GetCrmServiceForOrganization(organizationName));                     myCrm.ClientCredentials.Windows.ClientCredential =

Get Microsoft Dynamics CRM 2013 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.