Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Limit number of returned records in Query

$
0
0

Hi Guys,

I'm working to get the last 3 customer transactions in AX 2012. I have a query that I used in a view to display the records. The records being fetched is either open or invoiced sales line order. There where no other criteria set in the query. I can display the last 3 records - which i have a class and select the records using a while statement in the class. Though I can output the correct records, I am concern with the optimization when the view is used in the class (for processing). Cause for sure, the view will contain all the customer transaction, and I'm considering the amount of time it requires to process just to get the last 3 records. 

In SQL, a TOP 3 keyword can be used to fetch the 3 records. I am not sure if there is an equivalent way of doing this in AX. FirstOnly can only be used in select statement and not in a while select.

Any thoughts please.

Thanks.


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>