Entity incident = new Entity();
incident.LogicalName = "incident";
//Assign a case!
AssignRequest assignRequest = new AssignRequest();
assignRequest.Assignee = new EntityReference("systemuser", createdbyuser);
Guid IncidentID = new Guid(checkincidentid);
assignRequest.Target = new EntityReference(incident.LogicalName, IncidentID);
//sets the new User.
_service.Execute(assignRequest);
}
catch (Exception exa)
{
embody = " Failure in assign " + exa.Message;
emsub = "Navision/CRM New Item Interface Failed";
sendEmail(ref emsub, ref embody);
Console.Write(exa.Message);
continue;
}
}
}
}
reader.Close();
}
catch (Exception ex)
{
string embody = " Failure in Main " + ex.Message;
string emsub = "Navision/CRM New Item Interface Failed" ;
sendEmail(ref emsub, ref embody);
Console.Write(ex.Message);