Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Create query method with parameter condition

Posted on by 2
I need to create a query method with parameter condition like the following
 
Select QTY from inventtrans where datefinancial <= @Startdate
  • Martin Dráb Profile Picture
    Martin Dráb 230,214 Most Valuable Professional 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 230,214 Most Valuable Professional 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?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans