Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to update a list item from a list with a single column 'Test' and I'm getting the following error:

Request failed. This task is currently locked by a running workflow and cannot be edited

flush: function (successCallback, failCallback) {
  var self = this, clientContext, oList;

  var id = self._userSPListItem.GetId();

  SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () {
    clientContext = new SP.ClientContext(_spPageContextInfo.siteAbsoluteUrl);
    oList = clientContext.get_web().get_lists().getByTitle('MyList');

    var oListItem = oList.getItemById(id);

    oListItem.set_item('MyField', 'Test');

    oListItem.update();

    clientContext.executeQueryAsync(Function.createDelegate(this, successCallback), Function.createDelegate(this, failCallback));
 });
}
share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.