Wednesday, June 7, 2017

"No elements are found in AOD files in the old directory" error in Ax2012

Hi guys,

Today while applying GST patch for one of our clients I faced an error in Code Upgrade. I had installed the hotfix and run the "Detect Code Upgrade Conflicts" and I received an error which said "No elements are found in AOD files in the old directory. The layer conflict project will not be created.". So of course after googling a bit I got a solution to this:

Modify the detectConflictsRun method on SysUpgradeDetectConflicts class like below:
Comment the code that checks for a record on utilElementsOld Table and sets layerDetectorRequirementsOk variable to True.

   // check if the Old directory exists
   /*select firstonly RecId from utilElementsOld;
   if (utilElementsOld.RecId)
   {
       layerDetectorRequirementsOk = true;
   }
   else
   {
       layerDetectorRequirementsOk = false;
       // Inform user that the layer project will not be created
       info("@SYS106623");
   }*/
   layerDetectorRequirementsOk = true;

And that works like a charm and you will get a project with code conflicts. :)

Credits: https://community.dynamics.com/ax/f/33/t/123783