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)

how to filter data using excute query method

(0) ShareShare
ReportReport
Posted on by 327

final.png

i have 3 lines of data in my form form having two data sources one is pricedisctable,inventdim.
in that form customer ALMT-000001 having 2 lines and ALMT-000002 having one line if i open
a form it should show latest transaction customer wise based on fromdate means ALMT-000001 should show only line that is 7/10/2017
my quastion is in that form two data sources are there which data source i need to write excutequery method

thanks in advance....

*This post is locked for comments

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

    This seems to be a duplicate of how can i filter latest data through x++ query. Please don't create multiple threads about the same things; continue in your original one. You've got some suggestions there and you didn't say that they don't work for you and why, so it should likely be your next step.

  • Israel Gonzalez Profile Picture
    733 on at

    Hi Karthik143,

    This seems you want to filter when selecting the record, isn't it?

  • Suggested answer
    Ajit Profile Picture
    8,755 on at

    Answer to your this question - which data source i need to write excutequery method

    You should find which data source has that date column and use that.

  • karthik143 Profile Picture
    327 on at

    no if i open a form it should show filtered records.

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Could you please try the answers suggested on your other open thread on the same issue.

    https://community.dynamics.com/ax/f/33/t/242983

    Thanks,

    Chaitanya Golla

  • karthik143 Profile Picture
    327 on at

    hi Mr.Chaitanya still i didnt apply ur logic once i have done ill let you know....

  • Suggested answer
    Israel Gonzalez Profile Picture
    733 on at

    Hi Karthik,

    I understand that you don't know where override the executeQuery(). I recommend you override the method in the main table datasource, for example, if you have CustTable and SalesTable and you want filter by AccountNum, the method would be in CustTable datasource and your code like this:

    public void executeQuery()

    {

       this.query().dataSourceTable(tableNum("CustTable")).addRange(fieldNum(CustTable, AccountNum)).value(AccountNumParameter);

       qbr = this.query().dataSourceTable(tableNum("CustTable")).addRange(fieldNum(CustTable, AccountNum));

       qbr.value(queryValue(AccountNumParameter));

       super();

    }

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