web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Difference between setCursor and setRecord?

(0) ShareShare
ReportReport
Posted on by 307,719 Super User 2026 Season 2

Hi all,

It is possible to use the datasource.setCursor(common) and datasource.setRecord(common) functions to use temporary tables in queries. It is also applicable on a QueryRun object.

Can anyone tell the difference between these methods?

*This post is locked for comments

  • DavidSturt Profile Picture
    4 on at

    I would like to see this clarified also.  There is no documentation on MSDN for either method.  I also looked through the Inside Dynamics AX books, Morphxit book, developer manuals and was unable to find anything specific for either method.

  • DG Profile Picture
    1,226 on at

    Hi Andre,

    I have used 'setCursor' in form data source to select a particular record in grid by code. In QueryRun, I have tried using both 'setCursor' and 'setRecord' methods but no use. Once any of these methods are used, no more records are found by QueryRun.

    Regards,

    Deepak

  • André Arnaud de Calavon Profile Picture
    307,719 Super User 2026 Season 2 on at

    Hi Deepak,

    Thanks for your reply. In my test case the QueryRun works with using a temporary table  with both methods. I was just wondering if there is a difference to have the best choice.

  • Klaas Deforche Profile Picture
    2,433 on at

    Hi André,

    This question was asked here also: https://translate.google.com/translate?hl=nl&sl=ru&tl=en&u=http%3A%2F%2Faxforum.info%2Fforums%2Fshowthread.php%3Ft%3D11356

    It's an old post from 2005 though. From what I understand the implementation of both functions is the same and it is speculated that they are both there to allow for backwards compatibility.

  • André Arnaud de Calavon Profile Picture
    307,719 Super User 2026 Season 2 on at

    Hi Klaas,

    Thanks for your reply. I also found the link and translated it before I asked the question on this forum. It is still not clear if there is a difference. Probably it is really the same.

    A query object uses both. A formdatasource only the setRecord. So probably one is indeed for backwards compatibility with very old AX versions.

    I will start a search in AX to see when and where these methods are used. Maybe this provides some more insights.

  • Denis Macchinetti Profile Picture
    16,444 on at

    Hi Guys

    From my experience, AX use more SetRecord than SetCursor, especially on the "new code".

    I'm agree also with the post. Is possible to find again Setcursor for a compatibility issue.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans