Wednesday, May 15, 2019

AX 2012 | compilation warning | SysDictClass::is method is obsolete

I got this warning from AX 2012 R3 CU13.











The SysDictClass::is method is obsolete. Use the IS operator instead.


Solution
I found a helpful tip from http://dynamics-ax-chronicles.blogspot.com/2011/07/form-control-type-at-run-time.html .

So after I change the code manually as follows, the warning is resolved.

     //if (SysDictClass::is(element.args().caller(), classnum(FormRun)))  
     if (element.args().caller() is FormRun)  

Until the next post!


Tuesday, May 14, 2019

AX2012 R3 | Issue while upgrade code | axmodel is from a newer version and cannot be installed

I found an issue while upgrade AX 2012 R3 code to the latest CU (6.3.6000.8.144).


















https://cloudblogs.microsoft.com/dynamics365/no-audience/2012/03/29/overview-of-microsoft-dynamics-ax-build-numbers/?source=axsupport






However while I upgrading the binary(kernel) and application, I got the error.

The model file C:\ProgramData\Microsoft\Dynamics AX\Package\2019-05-14 13-57-20\GranularModels\DynamicsAX2012R3_CL4581239.axmodel is from a newer version of Microsoft Dynamics AX (version 6.3.6000.6863) and cannot be installed.






























Found update model(File: C:\ProgramData\Microsoft\Dynamics AX\Package\2019-05-14 13-57-20\GranularModels\DynamicsAX2012R3_CL4581665.axmodel, Layer: Syp, Name: Hotfix-KB4492605-4581665-Foundation, Version: 6.3.6000.8136, Partition: Foundation)
Found update model(File: C:\ProgramData\Microsoft\Dynamics AX\Package\2019-05-14 13-57-20\GranularModels\DynamicsAX2012R3_CL4581666.axmodel, Layer: Syp, Name: Hotfix-KB4492767-4581666-Foundation, Version: 6.3.6000.8141, Partition: Foundation)
Found update model(File: C:\ProgramData\Microsoft\Dynamics AX\Package\2019-05-14 13-57-20\GranularModels\DynamicsAX2012R3_CL4581667.axmodel, Layer: Syp, Name: Hotfix-KB4492770-4581667-Foundation, Version: 6.3.6000.8145, Partition: Foundation)
Evaluating applicability requirements for model file: C:\ProgramData\Microsoft\Dynamics AX\Package\2019-05-14 13-57-20\GranularModels\DynamicsAX2012R3-KB4103631-FoundationUpgrade.axmodel
Required model (Layer: SYS, Name: Foundation Upgrade, Version: 6.3.164.0) is installed: False
Evaluating applicability requirements for model file: C:\ProgramData\Microsoft\Dynamics AX\Package\2019-05-14 13-57-20\GranularModels\DynamicsAX2012R3-KB4103631-SYPLabels.axmodel
Required model (Layer: SYS, Name: Foundation, Version: 6.3.164.0) is installed: True
Update model file is installed: False
Getting contents of model file C:\ProgramData\Microsoft\Dynamics AX\Package\2019-05-14 13-57-20\GranularModels\DynamicsAX2012R3_CL4581239.axmodel
Exception: Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.ModelBuildVersionException

 Message: The model file C:\ProgramData\Microsoft\Dynamics AX\Package\2019-05-14 13-57-20\GranularModels\DynamicsAX2012R3_CL4581239.axmodel is from a newer version of Microsoft Dynamics AX (version 6.3.6000.6863) and cannot be installed.


 FullText: Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.ModelBuildVersionException: The model file C:\ProgramData\Microsoft\Dynamics AX\Package\2019-05-14 13-57-20\GranularModels\DynamicsAX2012R3_CL4581239.axmodel is from a newer version of Microsoft Dynamics AX (version 6.3.6000.6863) and cannot be installed.
   at Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.ModelAssemblyReader..ctor(String modelAssemblyFileName, AxUtilContext context, AxUtilConfiguration config, SqlResources sqlResources)
   at Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.AxUtil.View(String modelFileName, Boolean verbose)
   at Microsoft.Dynamics.Setup.ApplicationModelFile.GetModelElements()


Reason
The reason is I originally launched the axupdate.exe from the older KB. In this case, It is KB4032175 (or CU13).
**I launch from KB4032175 instead, because KB4492767 file consists only binary(Kernel) update.











However, in the updating processes, I found the newer update, so I chose the newer one. That caused the above trouble.




































Solution
So choose only the CU version that matches to the axupdate version, then the issue is resolved.
























































Until the next post!

Monday, May 13, 2019

AX2012 | CIL generation warning | sysEPWebPageDefinition

During my AX 2012 R3 RTM installation, I found some warnings left after do 'Generate full CIL'.











Path
\Classes\sysEPWebPageDefinition\deployModuleOnServer (1st line)
\Classes\sysEPWebPageDefinition\deployPageOnServer (2nd line)

Error message
CIL generation: Exception was thrown because the .NET instance method Microsoft.Dynamics.Framework.Portal.Deployment.EPWebModule.DeployWebModuleFromAOT was not found during CIL generation in class sysEPWebPageDefinition.deployModuleOnServer. (1st line)

CIL generation: Exception was thrown because the .NET instance method Microsoft.Dynamics.Framework.Portal.Deployment.EPWebPartPage.ImportWebPartPageFromAOT was not found during CIL generation in class sysEPWebPageDefinition.deployPageOnServer. (2nd line)

Analysis
First of all, it seems to be that you can ignore this kind of warning if you're not interested to use Enterprise portal or SharePoint function.

However if you would like to clean up all of above warning. You need to install SharePoint Foundation 2010 (even you don't use it further).

Solution
1) Install MS SharePoint foundation 2010, and configure a SharePoint site.

2) Do 'Compile forward' the classes.

3) Do 'Generate full CIL' again, the warning should be disappeared.


Thanks for reading!


Ref:
https://community.dynamics.com/ax/f/33/t/227923
https://community.dynamics.com/ax/f/33/t/134993
https://cloudblogs.microsoft.com/dynamics365/no-audience/2011/02/14/sample-steps-on-installing-and-configuring-sharepoint-2010-and-deploying-ax-2009-role-centers-and-enterprise-portal/ (SharePoint install and configure guideline)





AX2012 | CIL generation warning | .NET type Symmetry.TaxEngine.BenefitType is not found during IL generation

During my AX 2012 R3 RTM installation, I found some warnings left after do 'Generate full CIL'.


Path
\Classes\PayrollCalculatePayStatementBenefits\retrieveSymmetryBenefitLimits

Error message
CIL generation: Severe Warning: .NET type Symmetry.TaxEngine.BenefitType is not found during IL generation. 'PayrollCalculatePayStatementBenefits.retrieveSymmetryBenefitLimits' will throw an exception at run time.


Analysis
First of all, it seems to be that you can ignore this kind of warning if you're not interested to use US Tax payroll function.

However if you would like to clean up all of above warning. The possible ways are:

Option A -  Install related components or libraries US Tax payroll functions needed. However at the moment I don't have details about this. ; )  (Would be good if someone can help to clarify as well)

Option B -  And this is my choice. Just omit it! Because of my current tasks not related to that tax feature, so disabling the function is fit to me.

Solution (as skip)
1) Deselect the US payroll function


















2) After that, do generate full CIL again. The warnings would be disappeared.


Until the next post!