Hello. I am trying to update a custom attribute of an incident (case): new_count using the CRM 4.0 SDK. I have the below code where I have specified the guid of the incident I want to update, but not sure what code to write to update the incident's custom attribute:
public static void UpdateCaseCountAttribute(Guid case_guid, int count, CrmService service) { incident incidentCase_update = new incident(); incidentCase_update.incidentid = new Key();
// add guid of case to be updated incidentCase_update.incidentid.Value = case_guid; // writing below code to update new_count fails incidentCase_update.new_count = count; TargetUpdateIncident target = new TargetUpdateIncident(); target.Incident = incidentCase_update; UpdateRequest updateRequest = new UpdateRequest(); updateRequest.Target = target; service.Execute(updateRequest); }
How could one update an incident's custom attribute?