cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Cloud SDK for JavaScript: Count operation missing?

03-21-2020 6:05 PM
38782 views 2 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hello all,
Continuing my journey with the Cloud SDK for Javascript 🙂

I noticed that there is no "count()" function for generated entities, whereas it seems to be there when using the Java flavour of the SDK:

long doeCount = new DefaultBusinessPartnerService()
    .getAllBusinessPartner()
    .filter(BusinessPartner.LAST_NAME.eq("Doe"))
    .count()
    .execute();

Am I missing something?

Although not necessary, it can be useful to build a some sort of paging mechanism, considering APIs like the SuccessFactors one which extracts a maximum of 1000 objects per request.

Any hint?

Thanks,
Roberto.

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

dhem
Advisor
Advisor
0 Likes

Hi Roberto,

you are right, we are indeed missing the count operation right now. As this is not on our immediate roadmap, I'd encourage you to open a feature request if you're interested in this feature.

When it comes to paging, I think top and skip are the operators that can be used for that (analogously to LIMIT and OFFSET in SQL).

Best regards,
Dennis

former_member231229
Participant
0 Likes

Hi Dennis! 🙂

I will open the feature request!
That's ok for the paging, the total count is useful when dealing with UIs (table pagination usually needs the total count value to generate the number of pages). Anyway, the count can be obtained via a separated simple http call.

Thanks for your time!

Roberto.

Answers (0)