Skip to Content
author's profile photo Former Member
Former Member

Service Layer, first 20 records in result

Hi,

I want to create a list with countries.

I get counties using by Service Layer ( https://server_name:50000/b1s/v1/Countries ). And in result I get the first 20-ty countries. But I want to get all countries.

How I can solve this problem?

Thanks,

Irina

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Jan 27, 2016 at 05:24 PM

    Hello, Irina.

    For best performance (and also best practice) Odata Services should not retrieve all information available at once. This could lead the client to heavy workloads, letting the UI freezed for example.

    That's why all Service Layer entities retrieves 20 records per call. To handle that you can use the Paging by accessing the odata.nextlink property that is returned everytime you call an entity with +20 objects.

    Or you can set the property PageSize on Service layer configuration (conf/b1s.conf)

    Now my paging is 25:

    Or you can User Odata recommended annotation odata.maxpagesize in the request header.

    *Next time, please use the SAP B1 SDK forum 😉


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 26, 2016 at 02:25 PM

    if you have a control where you are binding this odata model, then the control itself may have that limit of 20 set up. open the chrome developer tools (F12) and see the actual request. Alternatively, open a browser window, and paste the same request and see whether or not you get the entire list of countries you need..

    by odata definition, you should get the entire list if you query the entity.. but based on your description, it seems like maybe a control consuming the service is making the filter of top 20

    Add a comment
    10|10000 characters needed characters exceeded

    • if that is the case then there may be a setting on the data source preventing more than 20 records being returned... you can build up queries using odata syntax to see if you get more records...

      url/Entiry?$skip=20

      or try retrieving more records as..

      url/entity?$top=1000 // not sure if this will work as again there may be a setting on the source preventing more than 20 records being returned at a time

  • Posted on Jan 26, 2016 at 03:49 PM

    check ur code which provide the service

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.