0

I'm using below code to update multiple lookup fields of document library

Code:

var itemProperties = { '__metadata': { "type": "SP.Data.WP_x005f_DocumentsListItem" }, 'Technology_StackId': { "results": [1,2] }} // multi-valued field }

$.ajax({
        url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('" + listName + "')/items(" + itemId + ")",
        type: "POST",
        contentType: "application/json;odata=verbose",
        data: JSON.stringify(itemProperties),
        headers: {
            "Accept": "application/json;odata=verbose",
            "X-RequestDigest": $("#__REQUESTDIGEST").val(),
            "X-HTTP-Method": "MERGE",
            "If-Match": '*'
        },
        success: function (data) {
            success();
        },
        error: function (data) {
            failure(data);
        }
});

It is throwing below error:

A type named 'SP.Data.WP_x005f_DocumentsListItem' could not be resolved by the model. When a model is available, each type name must resolve to a valid type

Can someone please help me with this?

5
  • can you check SP.Data.WP_x005f_DocumentsListItem is correct? You can find by a GET request to /_api/Web/Lists/getbytitle('List Name')/ListItemEntityTypeFullName Commented Jul 21, 2016 at 11:53
  • i have checked that it is correct Commented Jul 21, 2016 at 11:53
  • This error is only related to ListItemEntityTypeFullName as far as I know nishantrana.me/2013/10/03/… Commented Jul 21, 2016 at 11:58
  • ya also know that but not able to update the field Commented Jul 21, 2016 at 11:59
  • Is it happen for this column only? Can you update other column except this Commented Jul 21, 2016 at 12:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.