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)

Execute Query Adding two Ranges to same Queryrange

(0) ShareShare
ReportReport
Posted on by 6


qbr = this.query().dataSourceNo(1).addrange(fieldNum(SalesTable, SalesStatus));
qbr.value(queryValue((SalesStatus::Backorder)));

qbr = this.query().dataSourceNo(1).addrange(fieldNum(SalesTable, DeliveryDate));
qbr.value(DateFilter.valueStr());

super();

This code doesn't seem to filter open order for a specific date. Please help.

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    Unfortunately we can't help you, because you didn't gave us any context. First of all, tell us where you're using your code, because it may be at a wrong place.

    Then tell us how you debugged it before giving it up and coming here.

  • NoobDaxCoder Profile Picture
    6 on at

    SalesTable_ds.ExecuteQuery. I wrote this code in SalesTable datasource execute query. SalesTable is in 1st position.

  • Verified answer
    Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    In which form?

    Also you still didn't mention any debugging. First of all, open personalization of your form, switch to the Query tab and review whether your ranges are there.

    I think you'll see them, but with invalid value of the DeliveryDate range, because you're setting it wrong. Use qbr.value(queryValue(DateFilter.dateValue()) instead of qbr.value(DateFilter.valueStr()).

  • NoobDaxCoder Profile Picture
    6 on at

    It is  a custom form. Datevalue() method solved the problem. I am learning Dynamics ax, in training.

    How to debug A query using debugger. For example, for a str, date variable i can see value being passed on to a variable. On other hand, for query, whatever is writern is transformed to select statement.. I am beginner Martin, any guidance will be greatly appreciated and I will be thankful for your help.

    querydebugger.png

  • Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    I'm not sure what you want to see instead. What you're doing is indeed building a SQL query that will be sent to database, therefore the debugger offers you a way to review whether you've really built what you intended.

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