Friday, December 7, 2007

Resolve cases In CRM 3.0

incidentresolution i_Resolution = new incidentresolution();
Lookup mylookup = new Lookup();
mylookup.Value = new Guid(CaseId.ToString());// CaseId=Ur case guid
i_Resolution.incidentid = mylookup;
Status mystatus = new Status();
mystatus.Value = 2; //completed
i_Resolution.statuscode = mystatus;


IncidentResolutionStateInfo i_stateinfo = new IncidentResolutionStateInfo();
i_stateinfo.Value = IncidentResolutionState.Completed;
i_Resolution.statecode = i_stateinfo;
CloseIncidentRequest i_closereq = new CloseIncidentRequest();
i_closereq.IncidentResolution = i_Resolution;
i_closereq.Status = -1;
CloseIncidentResponse myresponse =(CloseIncidentResponse)service.Execute(i_closereq);

No comments: