How to disable an active organization in CRM 2011 using C#/Vb.Net and CRM 2011 SDK or CRM 2011 WCF Services ? RRS feed

  • Question

  • Hi all,

    I want to be able to enable/disable a CRM 2011 Organization using Deployment Service (Deployment.Svc) or using CRM 2011 SDK (Microsoft.Xrm.Sdk.Deployment Namespace) using C# or VB.Net application.

    I am using some code like this:

    Dim StateReq As CRM2011DeploymentSvc.DeleteRequest
            Dim StateResp As CRM2011DeploymentSvc.DeleteResponse
            StateReq.EntityType = DeploymentEntityType.Organization
            StateReq.InstanceTag.Id = FoundOrganization.OrganizationId
            StateReq.InstanceTag.Name = FoundOrganization.UniqueName
            StateResp = CType(_CrmDeployService.Execute(StateReq), DeleteResponse)

    1. Q1: This code is OK as far as deletion of entities(Organization, accounts etc) is concerned. but i am more interested in Enabling and disabling the organization (occasionally) along deleting (when required).

    2. Q2: Lets say if i Delete an Organization, will i be able to undo delete or recover it. If yes then how and if not what else is the alternative? 3. Q3: In CRM 4.0 we can disable/Enable the organization using

    classes using the Deployment web service but in CRM 2011, the Deployment WCF Service does not contain any such method. What should i do to enable or disable the organization?

    Replies are much appreciated.

    Thank you.

    Thursday, March 31, 2011 12:07 PM