connect 2022 banner tablet connect 2022 banner mobile

Project Committed Cost Not Updating After Changes to PO in Dynamics AX

By David Boll | November 7, 2017

If you are running Dynamics AX 2012 and are doing work within the Project module you might have noticed an issue around committed costs on projects. In this example, we are looking at how committed costs work with Purchase Orders in Dynamics AX.

I’m going to assume you have a project setup along with a vendor. This scenario goes something like this.

  1. Create a PO and assign a project to it.
  2. Add a line to the PO
  3. Confirm the PO
  4. Go check your Committed Cost on the project and notice that everything is great
  5. You realize you made a mistake on the PO line so you go open the PO make your change and reconfirm
  6. You check your Committed Cost and realize that something isn’t right.

To fix this, there is a small code change that can be made to make sure that issue doesn’t happen again.

If you look at the ProjectCommitmentFacade class, in the doUpdateProjectCommitments method you will see that after a delete happens, the table buffer never gets cleared.

Simply, what you need to add is the following line to a couple places:
costControlTransComittedCostCheck.clear();

As an example:

if (!projectCommitmentsMap.exists(key))
{
//Relieve existing project commitment
        costControlPostingSourceDocumentLine =  CostControlPostingSourceDocumentLine::construct(
        		_sourceDocumentLineItem,
                costControlTransCommittedCost.ProjTransId,
                costControlTransCommittedCost.ProjId,
                costControlTransCommittedCost.CategoryId,
                costControlTransCommittedCost.ActivityNumber,
                costControlTransCommittedCost.LedgerDimension,
                0,
               	costControlTransCommittedCost.CurrencyCode,
                0,
                0,
                0);
          costControlPostingSourceDocumentLine.parmSupressMessages(_supressMessages);
          costControlPostingSourceDocumentLine.run(ProjCommittedCostUpdateAction::Delete);
          costControlTransCommittedCostCheck.clear();
}

With this simple change, your committed costs will now be correct, no matter what change you make on the PO.

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X