Hi,
I ihave an incident form in crm 2015. After spme operations the incident entity becomes passive. In my database the passive incident is to be understood by looking the state and status columns. If the incident is passive the statecode becomes 1 and the status code becomes 5.
After the incident becomes to be passive. I want to do someyhing to that incident entity.
As an operator i wanto to change the state and statu to activete the incident. (state=0,status=1)
If i success i wanto to update the new_anketgonderildi fielt (bit field) to true. Then make the incident again passive and update the entity.
But i got an error while updating the entity.
"This case has already been resolved. Close and reopen the case record to see the updates."
I realized that if the incident is active i can change the new_anketgonderildi field. When the incident is in passive situation i can not change. To change the bit value field i have to activeta the incident cahneg the bit field and than deactiveate the incident again.
How can i achieve this situation? Can anyone help me please?
*This post is locked for comments
Thank you Goutam. Your solutions solved my porblem. :-)
Hi ,
Try with this -
CloseIncidentRequest closeRequest = new CloseIncidentRequest(); Entity caseResolution = new Entity("incidentresolution"); caseResolution.Attributes.Add("incidentid", new EntityReference("incident", caseID)); caseResolution.Attributes.Add("subject", "Some text"); closeRequest.IncidentResolution = caseResolution; closeRequest.Status = new OptionSetValue(statusReason); // provide status reason like 5 CloseIncidentResponse closeResponse = (CloseIncidentResponse)service.Execute(closeRequest);
This error message gives inte second resp = (SetStateResponse)CRM.crmLib.Execute(staterequest); to passive the incident.
Hi Goutam, Thanks for you solution . It worked for me. But i need to passive the incident again. When i wanto to do this. It gives me "This message can not be used to set the state of incident to Closed. In order to set state of incident to Closed, use the CloseIncidentRequest message instead."
How can i solve this? please help me.
Hi ,
Unfortunately , you can not directly update the status by updating optionset value. You need to update using SetStateRequest . Please have a look below code .
SetStateRequest staterequest = new SetStateRequest(); //the entity you want to change the state of staterequest.EntityMoniker = new EntityReference("incident", caseID); //what should the new state be staterequest.State = new OptionSetValue(stateCode); //Pick an option from the status reason picklist to specify reason for state change staterequest.Status = new OptionSetValue(statusReason); SetStateResponse resp = (SetStateResponse)service.Execute(staterequest);
Hope this helps.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156