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

Announcements

No record found.

News and Announcements icon
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
    239,152 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
    746 on at

    Hi Karthik143,

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

  • Suggested answer
    Ajit Profile Picture
    8,788 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
    746 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans