Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to retrieve OData entity count AND data

johnhw
Discoverer
0 Kudos
1,060

I have seen several questions about this but no answer that has worked for me.

I am able to get the number of job requisition posting entities using:

/odata/v2/JobRequisitionPosting/$count?$params[…]

That works, but the data – the reqs themselves – are not included. Only the count is returned. The SuccessFactors API docs indicate the $count=true should work as a URL parameter, but this appears to be ignored, even in SF's own "Try Out" sandbox feature. It doesn't work in my org's implementation either.

I have also tried $inlinecount=allpages and that returns a server error.

I can call the API twice to get both the data and the count, but that seems ridiculously inefficient. Does anyone have a solution?

Thanks for your help!

John

1 ACCEPTED SOLUTION

evanireland
Product and Topic Expert
Product and Topic Expert
0 Kudos
865

I suppose the backend team should respond to this (I have no involvement there), but as a workaround if you need to send a $count query and one for the data, then maybe put them in a batch request to reduce latency.

3 REPLIES 3

evanireland
Product and Topic Expert
Product and Topic Expert
0 Kudos
866

I suppose the backend team should respond to this (I have no involvement there), but as a workaround if you need to send a $count query and one for the data, then maybe put them in a batch request to reduce latency.

johnhw
Discoverer
0 Kudos
865

Thank you, evanireland! I will look into batch processing. Appreciate your help.

CarlosRoggan
Product and Topic Expert
Product and Topic Expert
0 Kudos
865

Hi, as far as I remember, the $count returns only the number, this is intended and specified as such in the OData v2 specification, as a fast request to get only the number, e.g. to be displayed in the UI
To get the number as additional information in the payload, you have to use the inlinecount, as you mentioned.
If it throws an error, this is (either not supported or it should be) an error that needs to be fixed