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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Changing "order by" of a Composite Query

(0) ShareShare
ReportReport
Posted on by 10

Hello together,

is it possible to Change the "order by" of a Composite Query.

Thanks in advanced.

Best regards

Cetin Akbulut

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi cakbulut,

    Yes it is possible to change it . Try finding its x++ code and navigate it or try changing it .

    Regards,

    Sci

  • cakbulut82 Profile Picture
    10 on at

    Hello Sci,

    thanks for the answer. We have the SalesTableListPage Query and the Composite Query SalesTableListPage_Open.

    We want different "order by's" in both queries. Both queries are used for the SalesTableListPage. In the Composite query adding a order by is not possible. That is inherited from the parent query.

    With the following code it is possible to add the order by clause dynamically, but the code is not executed in the init-method of the Composite Query. Rather all methods are also inherited from the parent query.

    this.query().dataSourceName("SalesTable").addOrderByField(fieldName2id(tableName2id("SalesTable"), "SalesId"), SortOrder::Ascending);

    The idea was to override the init-method of the parent query, to add dynamically the order by clause. But in the init method of SalesTableListPage  we do not found a way to find out if SalesTableListPage or SalesTableListPage_Open was called. Unfortenately the args object of this.query().args() is empty.

    Do you know a way?

    Best regards

    Cetin Akbulut

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans