Wednesday, March 11, 2015

Firming planned order returns error message "Can not edit a record in net requirements(ReqTrans). An Update conflict occurred to another user process deleting or changing one or more fields in the record."

When firming a planned order that has pegged orders you may get the error message

"Can not edit a record in net requirements(ReqTrans). An Update conflict occurred to another user process deleting or changing one or more fields in the record."  which is

 
 
 
 
In order to fix the issue you will need to do the following:
 
Step 1. Update ReqTrans
  • Go to \Tables\ReqTrans
  • Change the property OccEnabled from "yes" to "no"


Check to see if the issue still happens, or if you now get a "forupdate was never selected or incorrect ttsbegin/commit" message go to step 2.


Step 2. Install update KB2910673
  • KB2910673 - When using the "Plan planning formula" window to firm batch orders the system displays the error "Cannot edit a record in Net requirements (ReqTrans)"

Check to see if the issue still happens. If it does go to step 3

Step 3. If you have made it this far then you are experiencing a known issue within AX. Here's what you will need to go in order to fix it.

  • Go to \class\ReqTransPoMarkFirm.updateFirmedReqTrans()
    • At the bottom of the method find the following code
    _reqTrans.InventTransOrigin = _inventTransOriginId;
    _reqTrans.RefType           = _refType;
    _reqTrans.RefId             = _refId;
    _reqTrans.IsForecastPurch   = NoYes::No;
    _reqTrans.update();
 
     
    //delete reqPo
    _reqPO.delete(true);

and replace with the following

variable objects needed:
    ReqTrans            reqTransCopy, updateReqTrans;
    ReqPO               reqPoCopy, removeReqPO;

    //update the transaction record
    ttsBegin;
    select forUpdate * from updateReqTrans where updateReqTrans.RecId == _reqTrans.RecId;
    updateReqTrans.InventTransOrigin = _inventTransOriginId;
    updateReqTrans.RefType           = _refType;
    updateReqTrans.RefId             = _refId;
    updateReqTrans.IsForecastPurch   = NoYes::No;
    updateReqTrans.update();
    ttsCommit;
    //delete the planned order
    ttsBegin;
    delete_from removeReqPO
    where removeReqPO.RecId == _reqPO.RecId;
    ttsCommit;


After completing all 3 steps the issue should be resolved.




4 comments:

  1. Thanks for this, any idea why this would suddenly start occurring after previously not having a problem?

    ReplyDelete
  2. We had the same situation where it would not crash 100% of the time and seemed very random. We originally were thinking it was due to the data. However it really came down to KB2910673 causing the issue. We are running 2012 R2 CU1

    ReplyDelete
  3. Hi Adam , where would i find the KB2910673 ?
    No luck with search on Customer Source.

    ReplyDelete