Skip to main content

Posts

Showing posts from September, 2012

ERROR: The model file MyModel.axmodel is from a newer version of Microsoft Dynamics AX (version 6.0.1108.670) and cannot be installed.

This is a common problem you may encounter when you are dealing with multiple build versions of AX 2012. Specially on a single server. This is because of the axutil used to import is a later (newer) version than the axutil used to export the model. If you have multiple build versions on a single server. Then I would recommend you use the command line method, rather than the powershell method. Also, use the axutil under the server folder. This should match the environment you are exporting from. Let me explain this another way. When you are running powershell method, it loads up the dll located under the ManagmentUtilities folder. When you use the command line you have a choice of using either AXUtil executable. C:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities\AXUtil.exe C:\Program Files\Microsoft Dynamics AX\60\Server\DynamicsAx2012\bin\AXUtil.exe Just see the properties of the dll. Notice the version number.

How to comment when modifying standard code [AX 2012]

I have seen many ways of modifying standard code and how commenting is done. The best practice is to make as little change as possible or as little impact to the standard solution as possible. Otherwise, making it stand out and the next person can clearly see the difference between standard code and custom code. Looking at how the Feature pack incorporates the Extension model is very interesting. See the screenshot below. You can see how the standard code is commented out with the <SYS> tag. Then the changes are added with their tag <PSA> or <RETAIL> as illustrated in the screenshot below. Now if you look at the compare, it stands out. If for some reason you had to revert your custom code back to the original. You just delete your code between your tags and uncomment the <SYS> tags. On msdn there is a best practice on how to do code commenting. http://msdn.microsoft.com/en-us/library/cc967435.aspx It clearly says: Do not use multi-line syntax /* … */ fo

Blank workspace on open of AX 2012 with Feature pack

I recently upgraded an environment and everything ran fine. After I finished the upgrade I tried opening AX and the workspace just showed nothing. No menus, just a blank workspace. This was an issue with the the Retail license key. It enabled a check during start up which failed. I had to run this script to insert a record to tell it, that it is finished. static void InsertRetailCheckListFinished ( Args _args ) { RetailSetupLog retailSetupLog; #SysCheckList   retailSetupLog = RetailSetupLog :: find ( classStr ( SysCheckList_Upgrade ) , #CheckListFinished ) ;    if ( retailSetupLog. RecId == 0 ) { retailSetupLog. clear ( ) ; retailSetupLog. Description = #CheckListFinished; retailSetupLog. Name = classStr ( SysCheckList_Upgrade ) ; retailSetupLog. RetailBuild = RetailSetupLog :: retailNo ( ) ; retailSetupLog. insert ( ) ;   info ( strFmt ( "Inserted build %1" , RetailSetupLog :: retailNo ( )

Analyse license types [AX 2012]

I wanted to do a quick analysis on the license types in AX and how the menu items affect them (by count). This is extremely useful when you are creating new roles too. I created a pivot table displaying the Roles on the Row, the License types on the Column and the Count of the Entry points (Menu items) as the value. This allows you to drill into the counts and find which menu items have make up a license type. Below is a quick job to export a csv file. Which can be opened up in excel to create the same pivot table. static void checkLicenseTypeByRoleEntryPoint ( Args _args ) {     SysSecRoleEntryPointsTmp    srepTbl;     SysUserLicenseMetadataTmp   slsaTmp;     SecurityRole                securityRole;     CommaTextIo                 commaTextIo;     FileIOPermission            permission;     MenuFunction                menuFunction;     str                          menuLabel;     str                          fileName = @ "C:\LicenseTypeByRoleEntryPoint.csv" ;     F

Installing Feature pack on AX 2012 CU3

I recently had to install the Feature pack on CU3 environment and I thought I should share my experience. Note: I won’t go through every single detail. Just the database and models.   Install the Feature pack for the Database using the full Feature pack disc This will warn you that you have a new model and it may override Install CU3 and this should import a model "Extensions update" model Install your custom model - merge whatever you need to merge Start your AOS - make sure your service and client are both on the CU3 build Run the client and you should see "The model store has been modified" pop up Select "Start the software update checklist" since this is a minor update The software update checklist will start Follow the check list - I did my merge already before so I didn’t run the "Detect code upgrade conflicts". I marked it as compete. You could do yours here. When you get to the "Synchronize database" it may f