0

I'm using the REST interface detailed here -https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ff521587(v%3Doffice.14)

As a proof of concept, I'm trying to access an item in a list from our Sharepoint 2010 intranet site and update a field.

To do this, I created a Connected OData service to the endpoint (AccountingWorkflowsDataContext) and here is my code -

var tasks = new AccountingWorkflowsDataContext(new Uri(
                    "https://mysite/_vti_bin/ListData.svc"));


tasks.Credentials = new NetworkCredential("username", "password", "domain");
var task = tasks.GLRecsTasks.Where(x => x.StatusValue != "Completed" && (x.AssignedToId == 1 || x.AssignedToId == 2)).First();

task.DueDate = DateTime.Now.AddDays(5);
tasks.UpdateObject(task);
tasks.SaveChanges();

I can connect to the list and I'm picking up the correct item and I'm tracking changes to it as well, however, the call to SaveChanges always fails with the message "An error occurred while processing this request." and the innner exception is -

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
  <code></code>
  <message xml:lang="en-US">An error occurred while processing this request.</message>
</error>

Can someone shed some light on this.

0

Please check this.

It looks like the Managed Client Object Model is the way to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.