Skip to main content
Microsoft Dynamics AX forum
Unanswered

Create query method with parameter condition

editSubscribe (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
Categories:
Attachments
  • Martin Dráb Profile Picture
    Martin Dráb 222,733 Super User on at
    Create query method with parameter condition
    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.
  • Create query method with parameter condition
    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
    Martin Dráb 222,733 Super User on at
    Create query method with parameter condition
    OK, so what do you need from us? Also, please give us some context.
     
    And what's your version of Dynamics AX?

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,183 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,733 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans