1
var TaskItemObject = {
  "__metadata": {
  "type": "SP.Data.TasksListItem"
  },
  "RelatedItems": '[{"ItemId":3,"WebId":"81d0cd95-2364-48a7-a7c3-f8fdaa2e263c","ListId":"1596591e-928a-4e59-b4b0-5346f5f60e58"},{"ItemId":11,"WebId":"81d0cd95-2364-48a7-a7c3-f8fdaa2e263c","ListId":"1596591e-928a-4e59-b4b0-5346f5f60e58"}]'
};

var queryUpdateCurrentTaskItem = $.ajax({
     url: _ProjectSiteURL + "/_api/web/lists/GetByTitle('Tasks')/items("+_TaskID+")",
     type: "POST",
     data: JSON.stringify(TaskItemObject),
     headers: {
                "Accept": "application/json;odata=verbose",
                "X-RequestDigest": $("#__REQUESTDIGEST").val(),
                "content-type": "application/json;odata=verbose",
                "IF-MATCH": "*",
                "X-HTTP-Method": "MERGE"
              }
  });

It gives me error: "{"error":{"code":"-2130575223, Microsoft.SharePoint.SPException","message":{"lang":"en-US","value":"This list is currently being managed by Project Web App, and cannot be edited directly"}}}"

Your Answer

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

Browse other questions tagged or ask your own question.