RetrieveRequest Class

Applies To: Microsoft Dynamics CRM 2013, Microsoft Dynamics CRM Online

Contains the data that is needed to retrieve a deployment entity or configuration settings record.

Namespace: Microsoft.Xrm.Sdk.Deployment
Assembly: Microsoft.Xrm.Sdk.Deployment (in Microsoft.Xrm.Sdk.Deployment.dll)


<DebuggerStepThroughAttribute> _
<DataContractAttribute(Name:="RetrieveRequest", Namespace:="")> _
<GeneratedCodeAttribute("System.Runtime.Serialization", "")> _
Public Class RetrieveRequest
    Inherits DeploymentServiceRequest
[DataContractAttribute(Name="RetrieveRequest", Namespace="")] 
[GeneratedCodeAttribute("System.Runtime.Serialization", "")] 
public class RetrieveRequest : DeploymentServiceRequest


// By instantiating the DeploymentServiceClient in a using statement you ensure that the client
// communication channel is closed and the object is disposed when it goes out of scope.

// CustomBinding_IDeploymenService is the name of the configuration setting for the CustomBinding

using (DeploymentServiceClient client = new DeploymentServiceClient("CustomBinding_IDeploymentService"))
    //The EntityIstanceId class is used to identify the object you want to
    // retrieve. You have the option of using name or ID.
    EntityInstanceId id = new EntityInstanceId
        Name = "AlpineSkiHouse"
    //Retrieve the organization
    Organization organization = (Organization)client.Retrieve(DeploymentEntityType.Organization, id);

The following is an example of an Organization class instance serialized to XML:

<?xml version="1.0" encoding="utf-8"?>
<Organization xmlns:xsi="" xmlns:xsd="">
  <ExtensionData />
  <BaseCurrencyName>US Dollar</BaseCurrencyName>
  <FriendlyName>Alpine Ski House</FriendlyName>


Pass an instance of this class to the Execute method, which returns an instance of RetrieveResponse.

You can use this message to retrieve any of the valid entity types as specified by the DeploymentEntityType enumeration.

An organization deployment object has five possible states as defined by the OrganizationState enumeration.

You can also use the corresponding Windows PowerShell command for the deployment entity you want to retrieve, for example, Get-CrmOrganization or Get-CrmSetting. For more information, see Administer the deployment using Windows PowerShel.

Note that this is for the Deployment Web service. To retrieve organization data records, use RetrieveRequest.

Inheritance Hierarchy


Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Development Platforms

Windows Server 2008, Windows Server 2012, Windows 7 (All Versions), Windows 8 (All Versions)

Target Platforms

Windows 98,Windows 2000,Windows 2000 Server,Windows CE,Windows Server 2008,Windows 98 Second Edition,Pocket PC,Smart Phone,Windows Server 2003,Windows XP Professional,Windows Server 2008, ,Windows Server 2012, ,Windows 7 (All Versions), ,Windows 8 (All Versions)

Change History

See Also


RetrieveRequest Members
Microsoft.Xrm.Sdk.Deployment Namespace

Other Resources

Use Deployment Entities and Deployment Configuration Settings

Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.