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)

Query returns no value

(0) ShareShare
ReportReport
Posted on by 625

Hi

I created a created a query (sysquery) forcusttable with ranges and I select value for cust account in the selection area of the runbase_Form class I wrote.

when I do the queryrun.next() loop I get no record back even the querybuilddatasource has the correct select statement and running this statement manually return the records.

Here my code to get data from the Queryrun:

while(this.queryrun().next())
{
    custTable = this.queryrun().get(tableNum(CustTable));

*This post is locked for comments

I have the same question (0)
  • CRSW Profile Picture
    625 on at
    RE: Query returns no value

    while(this.queryrun().next()) { custTable = this.queryrun().get(tableNum(CustTable));

  • Blue Wang Profile Picture
    on at
    RE: Query returns no value

    Hi CRSW,

    Check if there is data in your table.

    Maybe your other code part has joined multiple tables, and the addLink field causes your query to get no data.

  • CRSW Profile Picture
    625 on at
    RE: Query returns no value

    No. I do have 2 tables in the top-level of this query. No links between. Cust Table and Sales Table

  • Suggested answer
    Pedro Tornich Profile Picture
    955 on at
    RE: Query returns no value

    Hi CRSW,

    Having two tables on the top level seems to be the cause of your issues.

    Sometime when you try to write complex SQL statements (like having tables in a query with no joins) AX query gets lost and end up returning no values.

    You can try to synthesize your query in a view and then use the view in your custom.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans