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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

apply firstonly using query class

(0) ShareShare
ReportReport
Posted on by

How can I apply the below X++ query on query class

Select firstonly  pionHCMVacationSettlement  order  pionHCMVacationSettlement.RecID desc  where pionHCMVacationSettlement.posted==NoYes::No;

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Dick Wenning Profile Picture
    8,705 Moderator on at
    RE: apply firstonly using query class

    example

    static void Job22(Args _args)

    {

       Query q = new Query();

       QueryBuildDataSource qbds = q.addDataSource(tablenum(CustTable  ));

       qbds.firstOnly(true);

       SysQuery::findOrCreateRange(qbds,fieldNum(CustTable,AccountNum)).value('fdfd');

       qbds.addOrderByField(fieldNum(CustTable,AccountNum),SortOrder::Descending);

    }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#3
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans