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)

Get query from listPageInteraction class

(0) ShareShare
ReportReport
Posted on by 10,796 User Group Leader

Hi All,

How can I get the query from a listPageInteraction class in an eventHandler? I have following scenario.

Class: SalesQuotationListPageInteraction

Method: initializeQuery()

1212.query.jpg

I want to access query in eventHandler class and will then check query ranges there to perform some custom logic.

I have following eventHandler;

[PostHandlerFor(classStr(SalesQuotationListPageInteraction), methodStr(SalesQuotationListPageInteraction, initializeQuery))]
public static void SalesQuotationListPageInteraction_Post_initializeQuery(XppPrePostArgs args)
{
   SalesQuotationListPage salesQuotationListPage;
   Query query;

   SalesQuotationListPageInteraction salesQuotationListPageInteraction = args.getThis();
   ListPageArgs listPageArgs = salesQuotationListPageInteraction.listPage().listPageArgs();

   if (listPageArgs && listPageArgs.enumTypeParameter() == enumNum(SalesQuotationListPage))
   {
      salesQuotationListPage = listPageArgs.enumParameter();
   }

}

I have tried this method but it gives the query name not the actual query

str q = salesQuotationListPageInteraction.listPage().modeledQueryName();

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,286 on at

    What about

    Query q = args.getArg(identifierStr(_query)) ?

  • Faisal Fareed Profile Picture
    10,796 User Group Leader on at

    Excellent!!! worked like a charm

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
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans