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.
- Create a PO and assign a project to it.
- Add a line to the PO
- Confirm the PO
- Go check your Committed Cost on the project and notice that everything is great
- You realize you made a mistake on the PO line so you go open the PO make your change and reconfirm
- 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:
As an example:
//Relieve existing project commitment
costControlPostingSourceDocumentLine = CostControlPostingSourceDocumentLine::construct(
With this simple change, your committed costs will now be correct, no matter what change you make on the PO.