0

I have an issue with our Travel Tool based on SharePoint 2013.

This tool consists of different Content Types - all in their specific lists (travel requests, train rides, flights, etc.). There are two main groups which are using this tool: Employees (contribute) and admin staff (full control). On the homepage.aspx we have a ScriptEditorWebpart with a custom HomePageNewItem button and a ListView of the travel requests. When the user clicks on the custom button, a new ListItem is created via REST API and the EditForm.aspx of the currently created ListItem is displayed.

What is the problem?

This works just fine for the admin staff (full control). When employees try to create a ListItem, the following error message occurs: HRESULT: 0x80131904 (returning from the REST API). The same happens, when employees visit some of the lists. The ListView isn’t displayed, but there is the same error message.

Some additional information

  • The SQL database has enough storage on all partitions
  • When an employee uses the standard “New Item” Button, everything works just fine (except of the ListView)
  • When an employee is moved to the admin staff group, everything works just fine
  • All lists have correct permissions set
  • This worked one week before and there were no changes in the code, only some customizations of sites e.g. homepage.aspx)

Additional hints

Could it has something to do with the Website Definition?

The function which creates the list item

 function createListItem(listName, newItem, success) {
    var itemType = getItemTypeForListName(listName);
        newItem.__metadata = { "type": itemType }

        $.ajax({
            url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('" + listName + "')/items",
            type: "POST",
            contentType: "application/json;odata=verbose",
            data: JSON.stringify(newItem),
            headers: {
                "Accept": "application/json;odata=verbose",
                "X-RequestDigest": $("#__REQUESTDIGEST").val()
            },
            success: function (data) {
                success(data);
            },
            error: function (data) {
                var errorMessage = JSON.parse(data.responseText).error.message.value;
                var statusId;

                statusId = SP.UI.Status.addStatus("Hoppla:", errorMessage);
                SP.UI.Status.setStatusPriColor(statusId, "Blue");
                setTimeout(function () { SP.UI.Status.removeStatus(statusId); },10000);
            }
        });
    }

function getItemTypeForListName(name) {
        return "SP.Data." + name.charAt(0).toUpperCase() + name.split(" ").join("").slice(1) + "ListItem";
    }

Thanks in advance Benjamin

Benjamin Birk
  • 79
  • 2
  • 8

1 Answers1

0

Check the item count in the list. If there is more than 5000 items (aka. Threshold Limit) in the list, it is possible to receive similar errors using REST or it could be quite a range of possible problems You can try one of the following steps to know the exact cause:

  1. Check ULS logs for more detailed error message.
  2. Try to turn of throttling for the list. Use PowerShell to set property EnableThrottling for the SPList to $false.
  3. Sometimes other throttling issues can appear. Try to increase throttling limits for the web application. like increase maximum number of lookup columns for the list. Go to Central Admin -> Web Applications -> Resource Throttling and increase throttling limits.
  4. Remove some fields for testing. Try to play around removing some fields, especially lookups, user or date fields.
  5. Change your REST query and take only one or few item from the list.

Try something like this:

"/_api/web/lists/getbytitle('" + listName + "')/items?$top=5" 

or

"/_api/web/lists/getbytitle('" + listName + "')/items(1)",
ECM4D
  • 156
  • 1
  • 10