cancel
Showing results for 
Search instead for 
Did you mean: 

Service Layer, first 20 records in result

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member197733
Contributor

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

Former Member
0 Kudos

Thank you very much, Ralf

On SAP B1 SDK forum I do not always get an answer..)

Answers (2)

Answers (2)

junwu
Active Contributor
0 Kudos

check ur code which provide the service

Former Member
0 Kudos

How is it can help me ?

SergioG_TX
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Yes, I query the entity, but get only top 20 rows.

In Rest client I have the same result. And in developer tools of Chrome too.

SergioG_TX
Active Contributor
0 Kudos

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