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

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Create query method with parameter condition

(0) ShareShare
ReportReport
Posted on by 2
I need to create a query method with parameter condition like the following
 
Select QTY from inventtrans where datefinancial <= @Startdate
I have the same question (0)
  • Martin Dráb Profile Picture
    238,607 Most Valuable Professional on at
    OK, so what do you need from us? Also, please give us some context.
     
    And what's your version of Dynamics AX?
  • Community member Profile Picture
    2 on at
    Dear @Martin
     
    I'm working on a new report on Dynamics AX 2012 R3, I added parameters for the report like the start date.
    Now I created a query in a method and need to add a condition to calculate the QTY before the start date of the report.
     
    the query below that I created I need to refer the condition with the StartDate parameter.
     
    I'm new on development and following some documents to create the report.
     
     
     
     
     
  • Martin Dráb Profile Picture
    238,607 Most Valuable Professional on at
    There is no startDate variable in getAddedQty(). You have no such a variable declared in the method, no such a variable in the class header and also no such a variable was inherited from a parent class. Therefore the compiler is right when saying that such a variable doesn't exist.
     
    You have it in another class - the contract class. You can access the variable directly from other classes, but it's exactly what parmStartDate() method is for.
     
    By the way, running a separate query for every transaction would be very inefficient. You should try to create a query that calculates for all transactions at once.

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 662 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 280 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Martin Dráb 201 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans