5

I have a list generated from a BCS oData provider and I am attempting to get the number of items in the list so I can generate a $top on my request rather than bring back only the 100 item generic limit.

I am trying the following query in the cross-domain SP javascript, but it returns 0 items.

Any advice?

executor.executeAsync(
            {
                url: appweburl + "/_api/web/lists/getbytitle('Vendors')/itemcount", method: "GET",
                headers: { "Accept": "application/json; odata=verbose" },
                success: countSuccessHandler,
                error: errorHandler
            }
        );

2 Answers 2

0

I'm afraid you might not be able to retrieve accurate count because of the nature of the BCS queries which only return a Maximum of 2000 records normally. I would recommend you read this article http://social.technet.microsoft.com/wiki/contents/articles/9628.sharepoint-2010-row-limits-in-external-lists.aspx

Also one other potential way to read that information could be to create a custom read operation to call a stored procedure (if that is feasible).

0

Try with this endpoint url,

https://<site url>/_vti_bin/ListData.svc/<List Name>/$count
1
  • This end point URL does not work list with items more than 5000 items.
    – Pradeep
    Mar 26, 2019 at 12:47

Your Answer

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

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