locked
Cannot update Case Status to Resolved RRS feed

  • Question

  • i am using this code to change the status of case to Resolved, but it through an Exception 'server was unable to process the Request.

    here the code.

     

     SetStateIncidentRequest ssiReq = new SetStateIncidentRequest();

                ssiReq.EntityId = ticket_crmid;

                ssiReq.IncidentState = IncidentState.Resolved;

                ssiReq.IncidentStatus = -1;

                service.Execute(ssiReq);

     

    Thursday, September 2, 2010 11:09 AM

Answers

  • Hi Faisal,

    try using CloseIncident request and following is example code for the same...

    Hope this helps..

     

          try
          {
            incidentresolution activity = new incidentresolution();
            activity.incidentid = new Lookup();
            activity.incidentid.type = EntityName.incident.ToString();
            activity.incidentid.Value = IncidentId; //GUID
            
            activity.ownerid = new Owner();
            activity.ownerid.type = EntityName.systemuser.ToString();
            activity.ownerid.Value = new Guid(CaseOwnerId); //GUID
    
            //Resolution text 
            if (resolution.Length >= 2000)
            {
              activity.description = resolution.Substring(0,1999);
            }
            else
            {
              activity.description = resolution;
            }
    
            CloseIncidentRequest closeReq = new CloseIncidentRequest();
            closeReq.IncidentResolution = activity;
            closeReq.Status = -1;
    
    
            CloseIncidentResponse closeRes = (CloseIncidentResponse)
            service.Execute(closeReq);
    
            activity = null;
            closeReq = null;
    
          }
          catch (SoapException exs)
          {
            throw (exs);
          }
          catch (Exception ex)
          {
            throw (ex);
          }
    
    

     


    MayankP My Blog My twitter
    Thursday, September 2, 2010 11:23 AM

All replies

  • Thursday, September 2, 2010 11:12 AM
    Moderator
  • Hi Faisal,

    try using CloseIncident request and following is example code for the same...

    Hope this helps..

     

          try
          {
            incidentresolution activity = new incidentresolution();
            activity.incidentid = new Lookup();
            activity.incidentid.type = EntityName.incident.ToString();
            activity.incidentid.Value = IncidentId; //GUID
            
            activity.ownerid = new Owner();
            activity.ownerid.type = EntityName.systemuser.ToString();
            activity.ownerid.Value = new Guid(CaseOwnerId); //GUID
    
            //Resolution text 
            if (resolution.Length >= 2000)
            {
              activity.description = resolution.Substring(0,1999);
            }
            else
            {
              activity.description = resolution;
            }
    
            CloseIncidentRequest closeReq = new CloseIncidentRequest();
            closeReq.IncidentResolution = activity;
            closeReq.Status = -1;
    
    
            CloseIncidentResponse closeRes = (CloseIncidentResponse)
            service.Execute(closeReq);
    
            activity = null;
            closeReq = null;
    
          }
          catch (SoapException exs)
          {
            throw (exs);
          }
          catch (Exception ex)
          {
            throw (ex);
          }
    
    

     


    MayankP My Blog My twitter
    Thursday, September 2, 2010 11:23 AM
  • Hi. To solve incident you should use CloseIncident message. Sample .

    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Thursday, September 2, 2010 11:24 AM
    Moderator
  • thx it solve my problem
    Thursday, September 2, 2010 11:37 AM
  • you are welcome..
    MayankP My Blog My twitter
    Thursday, September 2, 2010 11:42 AM