hi does anyknow what wrong with this code its still not update casestatus (casestatus is mul choice)
try
{
trace.Trace("inside try");
//obtain the target entity from the inputparameter
Entity target = (Entity)context.InputParameters["Target"];
//rettrive
trace.Trace("retrieve task");
Entity entity = service.Retrieve("task", target.Id, new ColumnSet(true));
EntityReference regardingCaseRef = entity["regardingobjectid"] as EntityReference;
//retrive regarding from the back end
trace.Trace("2");
Entity regardingCase = service.Retrieve(regardingCaseRef.LogicalName, regardingCaseRef.Id, new ColumnSet(true));
//retrieve entityrecord from the ms crm server that match the
trace.Trace("4");
QueryExpression qeRelatedTasks = new QueryExpression("task");
qeRelatedTasks.ColumnSet = new ColumnSet(true);
qeRelatedTasks.Criteria.AddCondition(new ConditionExpression("regardingobjectid", ConditionOperator.Equal, regardingCaseRef.Id));
EntityCollection relatedTasks = service.RetrieveMultiple(qeRelatedTasks);
trace.Trace("check bool");
if (AllTaskReject(relatedTasks))
{
trace.Trace("status check");
// regardingCase["cos_csucasestatus"] = new OptionSetValue(769190006);
regardingCase.Attributes["cos_csucasestatus"] = new OptionSetValue(769190006);
service.Update(regardingCase);
}