How can I approve a workflow task using the ListData.svc? I am attempting to just set the value of ApprovalValue to "Approved" but this is not working at all. Any help you can give will probably save my day!
When I set the Approval to:
{"Value": "Approved"}
I get the following error:
"Error processing request stream. Deep updates are not supported in PUT operations."
UPDATE
I have discovered that I can change an item as expected if and only if the item is first approved via the GUI. I have no explanation as to why. If I create an approval item and then approve it using PowerShell
$list = $web.Lists["PAR_Tasks"]
$item = $list.GetItemById(1);
$item["Approval"] = "Rejected";
$item["RejectionReason"] = "Blah"
$item.Update();
and then go back and try to change ANY field using ListData.svc
I receive a server 500 error
and no information is logged. If I approve it in GUI and then change the value of a field using ListData.svc
the item is updated - I can change any field's value I wish.
Any task item that is NOT generated by the WF I can edit just fine by sending a POST with MERGE and
{
"ApprovalValue":"Approved"
}
as the payload.
I have tested this on 3 different environments and even on the out-of-the-box approval workflow on our department's production site. I get the same results every time. It appears you cannot approve or even change a workflow-generated task item using the ListData.svc Any manually generated item is fine.
Current Conclusion from Testing
My conclusion is that you must use a hybrid approach of ListData.svc with the ECMA CSOM to get the full range of functionality. I won't set this as an answer until it can be confirmed by someone smarter than me, though.
If any of you could take the time to test my theory, please do and I will give you the rep for the answer!
Also confirmed same behavior in SP 2013 using ListData.svc on a CloudShare instance!