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 :
Dynamics 365 Community / Forums / Finance forum / creating query in AOT
Finance forum

creating query in AOT

(0) ShareShare
ReportReport
Posted on by 942

Hello,

I'm trying to create my own AOT query in AX7.

 I follow thus article:

https://docs.microsoft.com/en-us/dynamicsax-2012/developer/walkthrough-creating-an-aot-query-that-has-group-by-and-having-nodes

I'd like to add count(RecId) field to field node as they write here:

Fields

Add a field under the new CustTable data source node.

  1. Expand the new data source node.

  2. Right-click the Fields node, and then click New > COUNT.

  3. In the Properties window for the new field node, set the Fieldproperty to RecId.

ANSI SQL typically uses an asterisk for the count aggregate function. But in Microsoft Dynamics AX a field must be used, and by convention the RecIdfield is usually used.

I use standard table "CustTable" as a datasource and can't add a field:

pastedimage1565884113264v1.png

I also can't add CustTable extension to my datasources node of the query. So the question is how to add count field?

Thanks.

I have the same question (0)
  • Martin Dráb Profile Picture
    236,857 Most Valuable Professional on at
    RE: creating query in AOT

    Try changing the Dynamic Fields property of CustTable datasource to No.

    You can't add table extensions. Add the extended table instead; it'll include fields from your extension.

  • Verified answer
    Andrew Xu Profile Picture
    3,877 on at
    RE: creating query in AOT

    Hi Azat,

    To add field in your datasource, you need to set the property 'Dynamic Fields' of your datasource to 'No'.

    pastedimage1565885552772v1.png

    pastedimage1565885583307v2.png

  • Suggested answer
    Satish Panwar Profile Picture
    14,671 Moderator on at
    RE: creating query in AOT

    Hi Azat,

    By default the setting is unselected and that should allow the field addition. Did you change the setting to "Yes" when you added the data source.

    pastedimage1565886169112v1.png

    Thanks,
    Satish Panwar
    Please take time to click 'Yes' against the answers that help you guide in right direction to help other community members

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans