Hey guys,
I'm using CRM 2015 on prem.
From the case webpage, I want my users to close all open tasks using a button (on my webressource)
When i attempt to close a task, I'm getting a "web 500 error" Iif i change the status to something else it works fine (differed or in progress)
code is fairly straightforward... (see bellow)
I wonder if its because i need to update statuscode And Statecode at the same time, (statuscode is not in tasks, and statecode is not in activitypointer)
activityId='98ec5ed5-ace6-eb11-813e-00155d012d09'
var entity = {};
entity.StatusCode = { Value: 4 };
var req = new XMLHttpRequest();
req.open("POST", Xrm.Page.context.getClientUrl() + "/XRMServices/2011/OrganizationData.svc/TaskSet(guid'"+activityId+"')", false);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("X-HTTP-Method", "MERGE");
req.send(JSON.stringify(entity));