Monday, September 30, 2013

AX2012 R2 CU6 Code Upgrade Checklist Error

If you are planning to do an In-Place code upgrade (AX2012 to AX2012 R2) and you are on CU6 there is a high chance you will get this little problem.

When you start the client and select the in-place code upgrade you get this error:
"Method SysCheckListItem.getMenuItemType must be overridden."


The solution is simply to just add one single method to one class.


In the SysChecklistItem_FixAxIDs add the method getMenuItemType and make it return the MenuItemType::Display enum value.



Compile the class and try run the checklist again. This is already documented on the download page for the update, but easy to miss. I'll admit I missed it the first time. If you searched for the error, hopefully you came here and you are now already back on track. :-)

Monday, September 9, 2013

Export list of model elements to Excel using PowerShell

So you want to get a list of all elements in a given model?
I tend to do it now and then, so here is how I do it.

Simply use the Get-AxModel to collect the details and pipe it to a Export-CSV.

(Get-AXModel -Model 'MyModel' -Details).Elements | select path, elementtype | `
Export-Csv -NoTypeInformation -Delimiter ';' c:\mymodel.csv

I've added the -NoTypeInformation to remove some unnecessary information, and I wanted to have the semicolon as delimiter in order for the file to open seamlessly in Excel 2013.



You can also list out other information as columns like the ElementHandle and ParentHandle.