When Firming Production orders getting error "Cannot edit a record in Production route activity (WrkCtrProdRouteActivity). The record Already exist."

Hi

Ax 2012 R2
path: Master planning > Planned orders > Select Planned production orders > Firm one order
When firming the Planned Production orders we are getting this error.
“Cannot edit a record in Production route activity (WrkCtrProdRouteActivity). Production: PRD-000xxxx, 60. The record Already exist.”

This is happening randomly and mostly happening for the Planned production Orders with Items that are set as phantom on BILL of Materials is having this issue.

Did anyone faced this issue before? Is there any hotfix that is available for this?

Any help will be appreciated. Thanks.

When Firming Production orders getting error “Cannot edit a record in Production route activity (WrkCtrProdRouteActivity). Production: PRD-000xxxx, 60. The record Already exist.” AX 2012 R2

Have you tried searching in LCS? If you cannot find one in LCS and if you can reproduce this issue, request a hotfix from Microsoft.

I am not sure how can i find it. Can you please help me with checking that?

I have tried searching, but couldn’t find any related Bug for AX 2012 R2.
You can try here, lcs.dynamics.com

Is this the number sequence? PRD-000xxxx, 60?

How is it getting the “,60” suffix?

Second question - does PRD-000xxxx, 60 actually exist as a production order?

I think 60 is the operation number. I error is showing both the Production Id and Operation, as there is a already a record in WrkCtrProdRouteActivity with that Prod Id and Operation number.

Which it cannot if the process is firming, unless this is being run over old data and the number sequence has been reset.

We are still facing this error. Do you have any suggestions? We are getting this error when we are trying to estimate the Production order.

Have you tried debugging?

We are able to fix this issue.

If the Production order contains item which is phantom, then when we click on estimate
its going through Table Method (table name: ProdRoute) UpdateReNumberOprNum where its finding the records
without the dataAreadId.
Hence its grabbing the records from Other companies which are having same ProdOrder number and throwing the
errors saying ProdOrderNumber xxx, 60 record already exists.
By making change so that the select command considers the DataAreaId, it worked.

We are using AX 2012 R2. So we fixed the code. We compared it with Ax 2012 R3 and this issue fixed in R3.

while select forupdate wrkCtrProdRouteActivity
where wrkCtrProdRouteActivity.ProdId == _prodId
&& wrkCtrProdRouteActivity.RouteDataAreaId == DataArea

Yes we did and found out the issue.