REST API for JobEntrySvc/JobEntries only returns 100 results

I’m using the /api/v1/Erp.BO.JobEntrySvc/JobEntries endpoint to try and query for all open jobs with $filter=JobComplete eq false . When I hit any endpoint in the JobEntrySvc really, it only returns 100 records.

The real issue here is that when I use $inlinecount=allpages, it always says 100 (even though there are thousands of jobs, and even when I use different filters or orderbys it always says 100, even though it’s returning different datasets), but when I $skip=100 it returns 0 records.

So it seems like something is blocking this service from returning more than the first 100 jobs no matter what, even when I use $skip?

For example JobEntrySvc/JobOpers?$skip=100 returns an empty array, but JobOperSearchSvc/JobOperSearches?$skip=100 returns more records.

Hi Jon (@jgr3go),
You can use the $top parameter to change the number of rows returned in the single query.

/api/v1/Erp.BO.JobEntrySvc/JobEntries?$top=1000 for example.

I’m also seeing an empty result set when using $skip=100 alone. If I use $skip=100 AND $top=100 it returns the next 100 records. I need to read more about OData to understand if this is correct behavior or not.

1 Like

If you are not a cloud customer, you can switch that limit off in web.config

Hello Olga!

Is this true for the BAQSvc too? I don’t remember seeing that behavior here in the class.

Thanks,

Mark

1 Like

Hi Olga,
Please specify the parameter.

1 Like

It looks like using $top with $skip does work, I don’t think that’s expected behavior. It’s not the case in other services.

That said, once you apply $inlinecount=allpages again it totally breaks. So it looks like there’s a bug in this service, at least.

I’m a cloud customer, so there’s nothing in the web.config I can change.

1 Like

To change/remove the limit use
<add key="DefaultMaxRowCount" value="<number or 0 to remove the limit>" /> into web.config section.

4 Likes

I think so, but it was long time ago when I looked

Sorry to Necro - but I have this same issue! Which section of the web.config gets this added key?

Is it like this?

	<security>
		<requestFiltering>
			<requestLimits maxAllowedContentLength="4294967295" />
			<!-- nope not here -->
		</requestFiltering>
	</security>
``

edited to remove potentially disastrous mistake

i don’t think so, it should be just in appSettings in Host.config (or web.config on pre .NET6)

1 Like

Thank you! It didn’t crash my DEV setup, anyways - I’ve asked the integrating developers (ETQ) to confirm it works and I’ll report back here.

@Olga THANK YOU! That worked, it was in host.config.

Returning data seems extremely slow, should I open a support ticket? Or a new topic here? Or is there some dumb newbie mistake I should have found in the docs?

This is duration in ms versus number of records. Of course, we shouldn’t need ETQ to return the whole Parts table every time, but it still seems slow:

image

Any thoughts?

Create BAQ instead

1 Like

Or a function, depending.

1 Like

agree to both…but this is for an integration with ETQ. “Give me all your parts”, they said. “We’ll be gentle”, they said.

And that being said, 30,000 parts in JSON appears to be 30 MB - should download in seconds, not hours. Or am I missing something?

Or, do you mean use BAQsvc even to return “all parts”?

BAQ is going to be faster. The BO has more overhead, paging, and other stuff I don’t understand.

1 Like

I agree with @olga and @klincecum. In a BAQ, you can also limit the columns that ETQ actually needs - reducing the size significantly.

And sure enough, 30,000 records is less than 2 seconds. Thank you all!