Tuesday, March 31, 2015

Duplicate type with name ‘Dynamics.Ax.application.*’ in assembly ‘Dynamics.Ax.application.* (2012 R2)

You may get an error while doing a CIL that says Duplicate type with name ‘Dynamics.Ax.application.*’ in assembly ‘Dynamics.Ax.application.* Which may be a result of you deleting an object and then reimporting it.

A result of this issue is many things within AX may stop working and if you go into

<Company>/System administration/Setup/Services and Application Integration Framework/Inbound Ports you will see many of the services have stopped and can not be restarted thus causing issues within the AX instance.

In order to fix this issue you will need to do the following(steps are listed as if you have a cluster of AOS instances)

  1. Stop all AOS instances
  2. Delete all files on the AOS server under C:\Program Files\Microsoft Dynamics AX\60\Server\<aos instance name>\bin\XppIL
  3. Connect to the model db via SQL Management studio
  4. Truncate the table SYSXPPASSEMBLY which lists all of the files found in step 2
    1. You can do this via the command: TRUNCATE TABLE SYSXPPASSEMBLY
  5. Start 1 AOS instance
  6. Run Full CIL
  7. Start remaining AOS instances


You should now look at the inbound ports to make sure everything now starts correctly. If this does not work you will need to run a full compile of the AOS and repeat the steps listed above.

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.