Hi,
Below the minimum rights required to Reactivate a closed or resolved Case in CRM.

Sample code to do it through code
private void Form_Load(object sender, EventArgs e)
{
Uri organizationUri = new Uri("http://servername/orgname/XRMServices/2011/Organization.svc");
Uri homeRealmUri = null;
ClientCredentials credentials = new ClientCredentials();
credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;
OrganizationServiceProxy orgProxy = new OrganizationServiceProxy(organizationUri, homeRealmUri, credentials, null);
IOrganizationService _service = (IOrganizationService)orgProxy;
ReactivateState("incident", new Guid("caseGuid"), 0, -1, _service);
}
public static void ReactivateState(string entityName, Guid entityGuid, int state, int status, IOrganizationService orgService)
{
try
{
SetStateRequest req = new SetStateRequest();
req.EntityMoniker = new EntityReference(entityName, entityGuid);
req.State = new OptionSetValue(state);
req.Status = new OptionSetValue(status);
orgService.Execute(req);
}
catch (Exception ex)
{
}
}
Bye.
Discover more from Nishant Rana's Weblog
Subscribe to get the latest posts sent to your email.
