Показать сообщение отдельно
Старый 10.11.2017, 10:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
stoneridgesoftware: Project Committed Cost Not Updating After Changes to PO in Dynamics AX
Источник: https://stoneridgesoftware.com/proje...n-dynamics-ax/
==============

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.



Источник: https://stoneridgesoftware.com/proje...n-dynamics-ax/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.