Announcements
What is the difference between firstOnly and firstFast keyword in a select statement and when should we use them?
*This post is locked for comments
Clear and precise. Wonderful
If our answers answered your question, you can mark them as accepted, this way other users will know quickly if this question has an answer or not.
Thanks Tom.
Thanks Anton and FH-Inway.
firstOnly returns (maximum) one record, it is used if you know in advance there will be only one record in the result set (when selecting on recId for example)
with firstFast your resultset can have multiple records, but it makes sure the first one is fetched faster than the remaining ones.
It is used for performance optimization (on forms and list pages for example, check blogs.msdn.com/.../ax2012-list-pages-performance-improvement.aspx)
Hi Rohan, firstOnly will select only the first record in the query so should be used when you need a single record only e.g. in the find method of your table. FirstFast will return the first records in the query faster than the following records, this makes sense when you are viewing data in a form but total time it takes might be more. Have a look at this article on MSDN.
firstFast
A priority hint. The first row appears more quickly but the total return time for this option might be slower. The firstFast hint is automatically issued from all forms, but is rarely used directly from X++.
firstOnly
Speeds up the fetch. Instructs MorphX to fetch only the first record
André Arnaud de Cal...
294,217
Super User 2025 Season 1
Martin Dráb
232,978
Most Valuable Professional
nmaenpaa
101,158
Moderator