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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Dynamically Update Sum of Real Value Field as Navigating Through Lines in Grid in AX 2012 R3

(1) ShareShare
ReportReport
Posted on by 61
 Public realI have a method to calculate the total consumption cost based on a production ID:
 getTotalConsumptionCost(ProdId _prodId)
{
    ProdJournalBOM prodJournlBOM;
    real totalCost = 0;


    select sum(ConsCost) from prodJournlBOM
           where prodJournlBOM.ProdId == _prodId;

    totalCost = prodJournlBOM.ConsCost;

    return totalCost;
} 


Where should I place the logic to calculate and update line-level data based on header information in AX 2012 R3?Should this logic be placed in the header table or the lines table? 
I want to ensure that the calculated value is accurate and up-to-date for each line.
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,917 Super User 2025 Season 2 on at
    Hi,
     
    Can you tell on what form you need the calculation and what exact tables are used as data source? What do you mean by the last two words "each line"? What lines are you referring to?
  • Fawad Ahmad Profile Picture
    61 on at

    Sorry for the late reply. Regarding the Production Order Cost Analysis customization:

    I have the following setup:

    • ProdTable in the header.
    • ProdJournalBOM in the line.

    I wrote a method in ProdJournalBOM, but the data in the field is inconsistent, whereas the calculations in the header table (ProdTable) are working correctly. How can I ensure that the line-level data accurately reflects the header information? Where should the logic to calculate and update line-level data based on header information be placed in AX 2012 R3?

  • Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at
    The logic in your method has a single parameter: prod ID. Putting it at the line level makes no sense, because all lines with the same prod ID will have the same value, because they'll call the same logic with the same parameter. If you want different values for different lines with the same prod ID, it's not just about the code placement. You need to add the missing logic.
     
    If you need more help, you'll need to give us more information about your goal. We see code you have at the moment, but we don't know what code you meant to write.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans