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 325

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

  • Suggested answer
    Israel Gonzalez Profile Picture
    Israel Gonzalez 733 on at
    RE: how to filter data using excute query method

    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();

    }

  • karthik143 Profile Picture
    karthik143 325 on at
    RE: how to filter data using excute query method

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

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: how to filter data using excute query method

    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
    karthik143 325 on at
    RE: how to filter data using excute query method

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

  • Suggested answer
    Ajit Profile Picture
    Ajit 8,755 on at
    RE: how to filter data using excute query method

    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.

  • Israel Gonzalez Profile Picture
    Israel Gonzalez 733 on at
    RE: how to filter data using excute query method

    Hi Karthik143,

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

  • Martin Dráb Profile Picture
    Martin Dráb 231,305 Most Valuable Professional on at
    RE: how to filter data using excute query method

    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.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans