It doesn’t seem right that the query only returns the results only when the top function is used. This is an Epicor hosted environment, so I assume the the server and the Rest API are setup correctly.
This is a problems with row limit and GetRows procedure.
By default only first 100 rows are returned from each table, starting from the top. So whne you ask for rows from the child table, top 100 rows are taken from top table, then child rows for that parent rows are found and filter is applied to them. If child table row you want to find does not belong to any of 100 parent rows, nothing is returned.
If you are not in Saas, then you can remove row limit in web.config. In Saas you can only use $top to override the limit.
Thanks for the explanation. If I have a large table my queries are going to take a long time. The tables are going to get large and I’ll never know what to set $top to. Thanks again.