tags:

views:

34

answers:

1

Hi All,

I need to programatically re-open an Incident/Case that has been closed. I have tried to do this by simply setting statecode & statuscode back to their starting values link text, but I still get a 'cannot perform this as entity is readonly' error.

+1  A: 

Using the CrmService, there are a number of SetStatus methods for the built-in entities.

For Incident, you would use SetStateIncident like this:

CrmService service = new CrmService();

SetStateIncidentRequest request = new SetStateIncidentRequest();

request.IncidentState = IncidentState.Active;
request.IncidentStatus = -1;

request.EntityId = <YOUR GUID HERE>;

SetStateIncidentResponse response = (SetStateIncidentResponse)service.Execute(request);

This code can be used in a plug-in, or other application (e.g. console app).

Forgotten Semicolon