tag:blogger.com,1999:blog-61527848230812133802024-02-19T15:48:00.622+00:00AX BytesThis blog describes my experiences with the MS Dynamics AX.Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.comBlogger55125tag:blogger.com,1999:blog-6152784823081213380.post-3570859119506753012018-06-05T07:00:00.000+01:002018-06-05T07:00:07.633+01:00Import label files X++Following job can be used to import multiple label files from a folder. The label files are not automatically saved in AOT so a manual Save all is required.<br />
<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: "andale mono" , "lucida console" , "monaco" , "fixed" , monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>static void LabelFileImport(Args _args)
{
#File
FilePath directoryPath, filePath;
Filename fileName, fileNameWithPath;
SysLabelFile labelFile;
Set languages;
System.String[] files;
System.Collections.IEnumerator enumerator;
directoryPath = @"D:\TempNav\LabelFiles"; // folder to import from
info(strFmt("Import path: %1", directoryPath));
try
{
files = System.IO.Directory::GetFiles(directoryPath, '*.ald');
enumerator = files.GetEnumerator();
}
catch
{
info(strFmt("Failed to get file list from path %1", directoryPath));
}
if (enumerator)
{
while (enumerator.MoveNext())
{
fileNameWithPath = enumerator.get_Current();
try
{
[filePath, fileName] = fileNameSplit(fileNameWithPath);
labelFile = SysLabelFile::newFilename(fileNameWithPath);
languages = new Set(Types::String);
languages.add(labelFile.parmLanguageId());
SysLabelFile::createLabelFileInAOT(labelFile.parmModuleId(), languages);
labelFile.importAldFile(fileNameWithPath);
info(strFmt("@SYS322092", fileName));
}
catch
{
info(strFmt("Filed to import file %1", fileName));
}
}
}
}
</code></pre>
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-21686244218193262232018-05-22T07:00:00.000+01:002018-05-22T12:06:23.067+01:00Export label files X++Following job can be used to export multiple label files of a particular language to a folder. There is an option to save the files as a different language file as well (in case the files are to be used for translation or to be imported as different language)<br />
<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: "andale mono" , "lucida console" , "monaco" , "fixed" , monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>static void LabelFileExport(Args _args)
{
#File
SysLabelFile sysLabelFile;
str labelModule, labelFileName, labelLanguage;
str labelSaveAsLanguage, labelSaveAsFileName;
container labelModuleCon;
int i;
FilePath path;
FileName fileName;
path = @"D:\TempNav\LabelFiles"; // folder to export to
labelModuleCon = str2con("ASC,ASG"); // labels to export
labelLanguage = "en-us";
labelSaveAsLanguage = "en-za"; // set as "" to export with original language name
if (!strEndsWith(path, #FilePathDelimiter))
{
path += #FilePathDelimiter;
}
info(strFmt("Export path: %1", path));
for (i = 1; i <= conLen(labelModuleCon); i++)
{
labelModule = conPeek(labelModuleCon, i);
try
{
labelFileName = strFmt("Ax%1%2.ald", labelModule, labelLanguage);
if (labelSaveAsLanguage != "")
{
labelSaveAsFileName = strFmt("Ax%1%2.ald", labelModule, labelSaveAsLanguage);
fileName = path + labelSaveAsFileName;
}
else
{
fileName = path + labelFileName;
}
sysLabelFile = SysLabelFile::newFilename(labelFileName);
sysLabelFile.toFile(fileName);
if (labelSaveAsLanguage != "")
{
info(strFmt("Successfully exported label file %1 as %2", labelFileName, labelSaveAsFileName));
}
else
{
info(strFmt("Successfully exported label file %1", labelFileName));
}
}
catch
{
info(strFmt("Failed to export label file %1", labelFileName));
}
}
}
</code></pre>
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-64808902183199793632018-04-05T11:59:00.000+01:002018-04-05T11:59:00.189+01:00Access error in batch jobs/printing of reportsRecently we had production machines operating system patched. After the patching, we had a production deployment of new code. When the AOS were brought back up, some of the application processes started throwing errors. These included AIF/workflow batch jobs, printing of some reports etc. The error message was as follows<br />
<br /><br />
Infolog for job AIF (5641187121)<br />Infolog for task AifInboundProcessingService (5651730951)<br />Cannot read a record in AifResponse (AifResponse).<br />The corresponding AOS validation failed.<br />AifInboundProcessingService-run<br />Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' was thrown.<br /> at Microsoft.Dynamics.Ax.MSIL.Interop.throwException(Int32 ExceptionValue)<br /> at Microsoft.Dynamics.Ax.MSIL.cqlCursorIL.DeleteAll(IntPtr table)<br /> at Dynamics.Ax.Application.AifResponse.deleteExpiredResponses() in AifResponse.deleteExpiredResponses.xpp:line 7<br /> at Dynamics.Ax.Application.AifInboundProcessingService.Run() in AifInboundProcessingService.run.xpp:line 35<br /> at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 54<br /> at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 13<br /> at BatchRun::runJobStatic(Object[] )<br /> at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)<br /> at BatchIL.taskThreadEntry(Object threadArg)<br />Infolog for task AifGatewayReceiveService (5651730959)<br />Cannot create a record in Gateway queue (AifGatewayQueue).<br />The corresponding AOS validation failed.<br />Cannot create a record in Gateway queue (AifGatewayQueue).<br />The corresponding AOS validation failed.<br />Cannot create a record in Gateway queue (AifGatewayQueue).<br />The corresponding AOS validation failed.<br />Cannot create a record in Gateway queue (AifGatewayQueue).<br />The corresponding AOS validation failed.<br />Cannot create a record in Gateway queue (AifGatewayQueue).<br />The corresponding AOS validation failed.<br />
<br /><br />
Infolog for job Workflow message processing (5641359370)<br />Infolog for task Workflow message processing task (5652234909)<br />User 'BatchUser' is not authorized to update a record in table 'SYSWORKFLOWTABLE'. Request denied.<br />Cannot edit a record in SysWorkflowTable (SysWorkflowTable).<br />Access Denied: You do not have sufficient authorization to modify data in database.<br />User 'BatchUser' is not authorized to update a record in table 'SYSWORKFLOWTABLE'. Request denied.<br />Cannot edit a record in SysWorkflowTable (SysWorkflowTable).<br />Access Denied: You do not have sufficient authorization to modify data in database.<br />SysWorkflowQueue-activate<br />SysWorkflow-lock<br />SysWorkflow-fault<br />SysWorkflow-internalFault<br />SysWorkflow-faultWorkflowInstance<br />Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' was thrown.<br /> at Microsoft.Dynamics.Ax.MSIL.Interop.throwException(Int32 ExceptionValue)<br /> at Microsoft.Dynamics.Ax.MSIL.cqlCursorIL.update(IntPtr table)<br /> at Dynamics.Ax.Application.SysWorkflow.faultWorkflowInstance(SysWorkflowTable _workflowTable, String _user, String _faultMessage) in SysWorkflow.faultWorkflowInstance.xpp:line 66<br /> at Dynamics.Ax.Application.SysWorkflow.internalFault(WorkflowContext _workflowContext, String _user, String _faultMessage) in SysWorkflow.internalFault.xpp:line 56<br /> at Dynamics.Ax.Application.SysWorkflow.fault(WorkflowContext _workflowContext, String _user, String _faultMessage) in SysWorkflow.fault.xpp:line 32<br /> at Dynamics.Ax.Application.SysWorkflowQueue.dispatch(Guid _affinity) in SysWorkflowQueue.dispatch.xpp:line 185<br /> at Dynamics.Ax.Application.SysWorkflowQueueTask.Run() in SysWorkflowQueueTask.run.xpp:line 13<br /> at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 54<br /> at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 13<br /> at BatchRun::runJobStatic(Object[] )<br /> at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)<br /> at BatchIL.taskThreadEntry(Object threadArg)<br />
<br /><br />
The error message showed that user does not have access to the tables. However even granting System Administrator was not fixing the issue. The only workaround we could find was to deactivate an AIF port. This somehow fixed the issue. <br />
<br /><br />
We opened a case with Microsoft and solution provided by MS engineer was to make sure that the SID in the following registry key was that of the account running AOS service. In our case the SID was that of the user who installed the AOS on these machines.<br />
<br /><br />
<span lang="EN-GB" style="color: black; font-family: "Calibri",sans-serif; font-size: 11pt; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dynamics\6.0\Setup\Dynamics
Server\setupuser</span><br />
<span lang="EN-GB" style="color: black; font-family: "Calibri",sans-serif; font-size: 11pt; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;"><br /></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcEAPEc2sV4duRO9bXPhuG3guflX_laj6UgTIFipqiPniXe4I9ZEflxzIi3d7sD0UwsSxH7aHIqx00b3fT7iZTRN55Vyxg8G42MHrKhCBEE7vXh2m80HRqVQev81Wv84fJiS7VTvagiqWQ/s1600/Image_20180401145204.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="210" data-original-width="935" height="140" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcEAPEc2sV4duRO9bXPhuG3guflX_laj6UgTIFipqiPniXe4I9ZEflxzIi3d7sD0UwsSxH7aHIqx00b3fT7iZTRN55Vyxg8G42MHrKhCBEE7vXh2m80HRqVQev81Wv84fJiS7VTvagiqWQ/s640/Image_20180401145204.png" width="640" /></a></div>
<span lang="EN-GB" style="color: black; font-family: "Calibri",sans-serif; font-size: 11pt; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;"><br /></span><br />
<span lang="EN-GB" style="color: black; font-family: "Calibri",sans-serif; font-size: 11pt; mso-ansi-language: EN-GB; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;">After changing the registry key on all AOS (while the AOS service was not running), the error disappeared. Please take a backup before modifying registry.</span><br />
<br /><br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-29880452075362962962018-03-24T11:25:00.000+00:002018-05-22T12:11:10.653+01:00BizTalk Server Application Configuration - SSO database export file enctyption/decryptionWhile working on AX integration using BizTalk, a requirement arose to save some of the configuration data. There are several options available as described in this <a href="https://social.technet.microsoft.com/wiki/contents/articles/6494.biztalk-server-application-configuration-options.aspx" rel="nofollow" target="_blank">article</a>. <br />
<br />
We decided to store the configuration in the SSO database. While the MMC snap-in provided by Microsoft is good enough, there is no option to bulk edit the Key/Value pairs stored in the SSO database. The snap-in does allow to export the file, but its encrypted and hence cannot be edited outside of the snap-in. <br />
<br />
We wrote a small utility which allows to decrypt/encrypt the files exportable from the snap-in. Once exported, the file can be decrypted, edited in a text editor, encrypted again and can be imported in the snap-in to create the key/value pairs in the SSO database.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLq4oMtaQIGktx0erljZwTzBTQpgledemUmMkKFEWjMe8wgUJZuY_c3DBaQN9i9XgaRlk4K9Uh-TTqSWgrPxDFsc-GaL7JMR-F7l75O3-MYzr4zzIIOqvEijLVbMAb2rfEM0xPLhFRf6E3/s1600/Image_20180401141758.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="233" data-original-width="457" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLq4oMtaQIGktx0erljZwTzBTQpgledemUmMkKFEWjMe8wgUJZuY_c3DBaQN9i9XgaRlk4K9Uh-TTqSWgrPxDFsc-GaL7JMR-F7l75O3-MYzr4zzIIOqvEijLVbMAb2rfEM0xPLhFRf6E3/s1600/Image_20180401141758.png" /></a></div>
<br />
The utility can be downloaded from <a href="https://1drv.ms/u/s!AgzUP7XZ6KE6hr9jKHWtLRsVim7jyQhttps://1drv.ms/u/s!AgzUP7XZ6KE6hr9jKHWtLRsVim7jyQ" rel="nofollow" target="_blank">here</a>.<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-72465545037151496372018-02-20T05:00:00.000+00:002018-04-01T11:26:45.669+01:00Synchronization error due to SQL Plan Guides<br />
<br />
Recently we had to create a plan guide in SQL Server (not a good long term solution). Everything seemed to be working fine until we had a production deployment and the database synchronization failed as shown in the screenshot below.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6TOGpvZ8eiGV5KJfoypbD36XodtiJAlMVVAgDI4d_-yq_EX2rJlb8vkSKYWbAgoVl7toETAn-pm2wDn0l7OwSt-2rqqUpHhJFWSm4VAv_ItXEE7kd4DlIXUXvocLHR6Dh0YmG88Pb0DR1/s1600/Image_20180401130700.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="260" data-original-width="561" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6TOGpvZ8eiGV5KJfoypbD36XodtiJAlMVVAgDI4d_-yq_EX2rJlb8vkSKYWbAgoVl7toETAn-pm2wDn0l7OwSt-2rqqUpHhJFWSm4VAv_ItXEE7kd4DlIXUXvocLHR6Dh0YmG88Pb0DR1/s1600/Image_20180401130700.png" /></a></div>
<br />
<br />
It seems that during synchronization a store procedure is recreated. As our plan guide was based on queries in the stored procedure, AX was unable to drop it. Only solution was to drop the plan guide (disabling the plan guide did not help) and re-create it after the synchronization.<br />
<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-5964279577890289842017-12-31T10:09:00.000+00:002017-12-31T10:09:49.397+00:00SSL/TLS error when calling a web serviceFor one of our integrations we received the following error when it was enabled in production.<br />
<br />
Could not establish secure channel for SSL/TLS with authority ''.<br />
<br />
The web service requires some certificates to be installed which were correctly installed. The web service was working fine on development machines. Initial investigation did not find anything different between the development/production systems. We then traced the web service calls using <a href="https://www.telerik.com/fiddler" target="_blank">Fiddler</a> on both development and production machines and that's when we found out that the number of ciphers are different on both environment. Production did not had the ciphers highlighted below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOydpNHw4nw8f-VVbF-HUgB25lO1-7VfHGNfSxAvhv6H2IMFqqRjVU61N8jlgRMtAluaBXgpX8bDWuNGhnQyqdEGHZYvfrEQtQgdR5mJ3NixONIoj6_vAR6S6QX_d2X8CH70WYcS3mMtiX/s1600/Image_20171231135801.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="172" data-original-width="352" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOydpNHw4nw8f-VVbF-HUgB25lO1-7VfHGNfSxAvhv6H2IMFqqRjVU61N8jlgRMtAluaBXgpX8bDWuNGhnQyqdEGHZYvfrEQtQgdR5mJ3NixONIoj6_vAR6S6QX_d2X8CH70WYcS3mMtiX/s1600/Image_20171231135801.png" /></a></div>
<br />
A quick search on internet pointed towards a windows KB (3172614) which adds new ciphers. Installing the KB fixed the issue.<br />
<br />
Note: The KB requires restart of the machine.<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-30622025934479995282017-12-21T13:23:00.003+00:002017-12-21T13:23:51.039+00:00Error "Data at the root level is invalid" when opening a reportRecently users reported that they receive an error when opening a particular report. The error is<br />
<br />
"Data at the root level is invalid. Line 1, position 1."<br />
<br />
The call stack of the error is<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_shCNBu87lwkuQbaVZ8zxu4EZ2cr47kTdOaK1NU5Wq2z1zUHbwVVc-H_btk27mgFKwOIABmF6qlgL4jeVUVZN_Fnk_DpgsHM3gUqmRlJkqqDfR2-va_X1gOB_6QIChIfsGDNmghqwhbCC/s1600/Image_20171221172129.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="495" data-original-width="495" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_shCNBu87lwkuQbaVZ8zxu4EZ2cr47kTdOaK1NU5Wq2z1zUHbwVVc-H_btk27mgFKwOIABmF6qlgL4jeVUVZN_Fnk_DpgsHM3gUqmRlJkqqDfR2-va_X1gOB_6QIChIfsGDNmghqwhbCC/s400/Image_20171221172129.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Even opening the report in Visual Studio was throwing the same error as shown below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtRYsULfD-s88QluHy7gRtxqentuINmXnJaGe89v2ZoIRw0tHy18iZKdxOLm-5XudZOK4eta-bUBKCVSiWDU5zOJrZS1ZrOJQge8gorxXvRdEpvHb40jC0gBWlyqfOfqZ72HCfv4_HJe-Q/s1600/Image_20171221171151.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="173" data-original-width="374" height="185" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtRYsULfD-s88QluHy7gRtxqentuINmXnJaGe89v2ZoIRw0tHy18iZKdxOLm-5XudZOK4eta-bUBKCVSiWDU5zOJrZS1ZrOJQge8gorxXvRdEpvHb40jC0gBWlyqfOfqZ72HCfv4_HJe-Q/s400/Image_20171221171151.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
We exported the report from the AOT and analysed it ina text editor. It turned out that there was a CU/KB applied and the report was part of it. However the report was never upgrade and it had comments from the code upgrade tool. Fixing these comments in text editor, re-importing the report in to AX and deploying it fixed the issue.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKV_6dU9ud5-L-Ta61aX-uQXZeFKJx7fGM9DggsKQLfF_6tLK3aKXysCxWHEohZ0B6Z7MCWOUMS3wWzsDlaaPXdkcPs1hzrz7ILHX8mSY_i8nQbQBDV4IsAGo4oF-Cy72g1WDvAqTQv13D/s1600/Image_20171221171448.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="352" data-original-width="997" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKV_6dU9ud5-L-Ta61aX-uQXZeFKJx7fGM9DggsKQLfF_6tLK3aKXysCxWHEohZ0B6Z7MCWOUMS3wWzsDlaaPXdkcPs1hzrz7ILHX8mSY_i8nQbQBDV4IsAGo4oF-Cy72g1WDvAqTQv13D/s1600/Image_20171221171448.png" /></a></div>
<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-60255056277288194562016-03-07T18:00:00.000+00:002016-03-08T17:52:00.998+00:00Error while activating inbound portLast week we received an error while trying to activate a previously working WCF inbound port. The error message was<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: "andale mono" , "lucida console" , "monaco" , "fixed" , monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>The service '<SERVICE_NAME_HERE>' could not be generated.\n Error: SysDictType object not initialized.
Stack trace
(S)\Classes\AifServiceDataTypeGenerator\generateType - line 76
(S)\Classes\AifServiceDataTypeGenerator\generateDataContractClass - line 127
(S)\Classes\AifServiceDataTypeGenerator\generateType - line 54
(S)\Classes\AifServiceDataTypeGenerator\generate - line 68
(S)\Classes\AifMessageContractGenerator\generate - line 22
(S)\Classes\AifServiceGenerator\generate - line 30
(S)\Classes\AifServiceGenerationManager\generateServices - line 102
(S)\Classes\AifPortManager\deployPort - line 22
(C)\Forms\AifInboundPort\Designs\DesignList\DeployPort\Methods\Clicked - line 12</code></pre>
The error message was shown on "AIF services" form "General" fast tab.<br />
<br />
On investigation we found out that there was a code merge between two TFS branches and somehow one of the EDT used in the service contract was removed. When AIF was trying to generate service artifacts, it could not find the EDT and hence was throwing above error. Once the EDT was re-created, the error disappeared and service activated successfully.<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com1tag:blogger.com,1999:blog-6152784823081213380.post-61722065953527645062016-02-21T18:00:00.000+00:002016-02-22T12:39:29.616+00:00A call to SSPI failed, AX-BizTalk WCF serviceRecently we developed integration between AX and an external system through BizTalk. The data flow from BizTalk to AX was using a WCF service. Everything worked fine in dev/test/uat systems. Once the code was deployed to production system and configured to talk to BizTalk we started getting the following error.<br />
<br />
A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The target principal name is incorrect<br />
<br />
On investigation we found that User Principal Name (UPN) was not setup properly on the BizTalk Send port. The UPN is usually the AD user under which AX service is running (in an email format e.g. axServiceUser@companydomain.com). It can also be viewed from the service WSDL URI. Find the service from the inbound ports and copy the WSDL URI.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAxDT4QLUyAh1e1ZU5YnymvyUh1Lusp_FoeRQMqTcLYkHKsJNPmtEJWYlv4gtCeTs_JvnAExT_E8KF6Ja1EVBRuV7mHZe4TD6pRpUExJXx2yrQklq-F_AQD4PkyI_nP7SQ_Wp6CeVDn9dL/s1600/Image_20160222_122247.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAxDT4QLUyAh1e1ZU5YnymvyUh1Lusp_FoeRQMqTcLYkHKsJNPmtEJWYlv4gtCeTs_JvnAExT_E8KF6Ja1EVBRuV7mHZe4TD6pRpUExJXx2yrQklq-F_AQD4PkyI_nP7SQ_Wp6CeVDn9dL/s1600/Image_20160222_122247.png" /></a></div>
<br />
Paste the URI in internet explorer and WSDL will be shown. Scroll to the end and UPN is shown (highlighted below).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNpAZ9as02ILfSGfHgI6jlx8-MwY6B4o3EKvrN_ruhwupEqkctXi71SGpFsdTCP9LEeyz8-c_ogXSUTj47b0sQNzUYb2-kyujAVQ8nkaz9IHjd8SQgWOhrXQiUglr0ZBUI8mHtJ4cc1gbI/s1600/Image_20160222_121928.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="178" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNpAZ9as02ILfSGfHgI6jlx8-MwY6B4o3EKvrN_ruhwupEqkctXi71SGpFsdTCP9LEeyz8-c_ogXSUTj47b0sQNzUYb2-kyujAVQ8nkaz9IHjd8SQgWOhrXQiUglr0ZBUI8mHtJ4cc1gbI/s640/Image_20160222_121928.png" width="640" /></a></div>
<br />
Copy this value and paste it in the "Endpoint Identity" in the Send port of BizTalk application as shown below<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ZYQyVCB9a57L-8K_UhOKMtcjZfG0fS7BGgI5TxrUCYG9jWYfcWhBNIe5NnxJAXB63i8fpanPJgJNrEGbYNVE_-UduazmLqkZvkJhW-CZTnfZBM5l8uiAvbjEokSE-w59kyLpdVqCynVM/s1600/Image_20160222_122550.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="392" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ZYQyVCB9a57L-8K_UhOKMtcjZfG0fS7BGgI5TxrUCYG9jWYfcWhBNIe5NnxJAXB63i8fpanPJgJNrEGbYNVE_-UduazmLqkZvkJhW-CZTnfZBM5l8uiAvbjEokSE-w59kyLpdVqCynVM/s640/Image_20160222_122550.png" width="640" /></a></div>
<br />
The error message should disappear.<br />
<br />
<b>Note</b>: There may be other causes (Kerberos/Double hop issues) of this error message. In our cause this was the only issue.<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com1tag:blogger.com,1999:blog-6152784823081213380.post-86073821739604622302016-02-15T18:00:00.000+00:002016-02-16T12:59:18.023+00:00Error when accessing AX7 VMFor last few days error started appearing when trying to login to local AX7 VM as shown below<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy9FwaRYlTYTGMAT2r8ur19LN1RlYnmEhGe6ConWMGjrGEcF09BVOgkebMtyNM4u2VhMJOQRCafcK_b_ZUgO0nHuCYbclvQMlMpx6VWJ6Jsya5AUWS0JMtj9D0lkj1DD0cI8V5ZRhdkqC_/s1600/Image_20160216_124305.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy9FwaRYlTYTGMAT2r8ur19LN1RlYnmEhGe6ConWMGjrGEcF09BVOgkebMtyNM4u2VhMJOQRCafcK_b_ZUgO0nHuCYbclvQMlMpx6VWJ6Jsya5AUWS0JMtj9D0lkj1DD0cI8V5ZRhdkqC_/s1600/Image_20160216_124305.png" /></a></div>
<br />
It seems the account we were using was created by MS and was provisioned as Admin in the AX7 VM. For some reason MS have now disabled the account and as a result we cannot access the AX7 environment.<br />
<br />
The solution is to provision another user as Admin in the AX7 VM environment. While signing up for AX7 preview (blog post <a href="http://axbytes.blogspot.co.uk/2015/12/how-to-get-ax-7-vm-to-run-locally.html" target="_blank">here</a>), you must have gone to portal.office.com and created a user there. The user login is in the form username@businessname.onmicrosoft.com. This user can be provisioned as an admin on the AX7 VM.<br />
<br />
On the AX7 VM desktop find the icon shown below<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDFIsjTJvNMv45GmeEkoIojb1_smrbK_9mnBtm0iOs-jdtjvWHPGo2nd-eUiH2hop3TqixZ7e6vpUZmKMj6Ll7KQ6Q2dxr1r-LDIYSd_KnwyiT0AMvbooKS5kFXBZQ2s9GQuyX0pJSAggQ/s1600/Image_20160216_124101.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDFIsjTJvNMv45GmeEkoIojb1_smrbK_9mnBtm0iOs-jdtjvWHPGo2nd-eUiH2hop3TqixZ7e6vpUZmKMj6Ll7KQ6Q2dxr1r-LDIYSd_KnwyiT0AMvbooKS5kFXBZQ2s9GQuyX0pJSAggQ/s1600/Image_20160216_124101.png" /></a></div>
<br />
Double click it and enter the user that was created on portal.office.com and click "Submit" button.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7iPV3KpEQjOjNzTPUBa2H8EvLJE25DxFN5n_4RQYaPAFKrNmwvntoIu_hhO5qQK-m_3lh_YWkwVrMR7MrZdAE2LSM5jp5Mat1xTgdlgRQzsqO6LmmTLK78LgOAPUHT5eHgaUiwaYsL5Kk/s1600/Image_20160216_124135.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7iPV3KpEQjOjNzTPUBa2H8EvLJE25DxFN5n_4RQYaPAFKrNmwvntoIu_hhO5qQK-m_3lh_YWkwVrMR7MrZdAE2LSM5jp5Mat1xTgdlgRQzsqO6LmmTLK78LgOAPUHT5eHgaUiwaYsL5Kk/s1600/Image_20160216_124135.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
It takes some time and then you should get the following message</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFIMkHEbFX_vQO37nTAIzOBMCy4pbL2k2QH4QSAEsdXlocTKHDBa5RWA2Z-n1ZMR3qWBl_2xr_T6jzjK9hgqbhVz2mQMOTKVwWeApl1lm8IWyYge0ItgKJi1jEm1cy212Dp_qkiks_rmGO/s1600/Image_20160216_124224.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFIMkHEbFX_vQO37nTAIzOBMCy4pbL2k2QH4QSAEsdXlocTKHDBa5RWA2Z-n1ZMR3qWBl_2xr_T6jzjK9hgqbhVz2mQMOTKVwWeApl1lm8IWyYge0ItgKJi1jEm1cy212Dp_qkiks_rmGO/s1600/Image_20160216_124224.png" /></a></div>
<br />
Now if you use the same user (that you provisioned above) to login to AX7, it should work.<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com1tag:blogger.com,1999:blog-6152784823081213380.post-2659008223258791622016-01-04T18:00:00.000+00:002016-01-05T18:28:43.230+00:00AX7 Application Code Store (ModelStore in AX2012)In different versions of Dynamics AX, application code is stored at different places and in different formats. Table below summaries this for last few versions.<br />
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td rowspan="2" style="background: #EAF1DD; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 47.55pt;" width="79"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<br /></div>
</td>
<td rowspan="2" style="background: #EAF1DD; border-left: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 78.8pt;" width="131"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<b><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">Pre-AX2012</span></b><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
<td colspan="2" style="background: #EAF1DD; border-left: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 226.35pt;" width="377"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<b><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">AX2012<o:p></o:p></span></b></div>
</td>
<td rowspan="2" style="background: #EAF1DD; border-left: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 55.5pt;" width="93"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<b><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">AX7</span></b><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #EAF1DD; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 112.95pt;" width="188"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<b><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">RTM</span></b><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
<td style="background: #EAF1DD; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 4.0cm;" width="189"><div align="center" class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center;">
<b><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">R2-R3</span></b><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #EAF1DD; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 47.55pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">Location</span></b><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 78.8pt;" valign="top" width="131"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">File System</span><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 112.95pt;" valign="top" width="188"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">Database - With Business Data</span><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 4.0cm;" valign="top" width="189"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">Database - Separate From Business Data</span><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 55.5pt;" valign="top" width="93"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">File System</span><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #EAF1DD; border-top: none; border: solid windowtext 1.0pt; mso-background-themecolor: accent3; mso-background-themetint: 51; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 47.55pt;" valign="top" width="79"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">Format</span></b><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 78.8pt;" valign="top" width="131"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">Proprietary Format</span><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 112.95pt;" valign="top" width="188"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">Tables</span><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 4.0cm;" valign="top" width="189"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">Tables</span><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 55.5pt;" valign="top" width="93"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #333333; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 7.5pt;">XML Files</span><span style="font-size: 9.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<br />
In AX7 Microsoft has not only changed the way application code is stored but also how it is grouped. Application code, that should stay together and is distributed/compiled as a unit, is called a Package.<br />
<br />
<b>Location:</b><br />
In AX7 the application code is saved in file system in a directory and is called <b>PackageDirectory</b>. The location of directory (along with other settings) is saved in a web.config file. Why web.config? Because the AX7 AOS is implemented as ASP.NET web application running on an IIS.<br />
<br />
In IIS right click on the site "AOSWebApplication" and click on Explore as shown below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvhVs_VEev0D3sqtsKwVCma0u9SGJ_bSuZoyOT-HgMPcXcS_wAG_8c36b1LgBzNVpZJTJPK9QVv1b7SRDU1rUJfQ0oDQlcPl0yoIgaYAVPqUyllRswf5beoeDFvvuTdOOXUH8Ygmd4pjw8/s1600/Image1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="193" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvhVs_VEev0D3sqtsKwVCma0u9SGJ_bSuZoyOT-HgMPcXcS_wAG_8c36b1LgBzNVpZJTJPK9QVv1b7SRDU1rUJfQ0oDQlcPl0yoIgaYAVPqUyllRswf5beoeDFvvuTdOOXUH8Ygmd4pjw8/s320/Image1.png" width="320" /></a></div>
<br />
In the folder, find web.config, open it with notepad and search for "Aos.PackageDirectory". This will have the location of application directory.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgkcA4O5m_C7ZGOruB1-yoi-wMEh4Oxbqi0loAAqUcTNCy2b1uLPro1o_64kRtVeS7KI_nQUM5eQgsP-IfMX-yNfiFtVjRGyWINDogIQco4AVQXP-xfNMWNE32MW4ngEOlghglXgsgHa19/s1600/Image2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="35" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgkcA4O5m_C7ZGOruB1-yoi-wMEh4Oxbqi0loAAqUcTNCy2b1uLPro1o_64kRtVeS7KI_nQUM5eQgsP-IfMX-yNfiFtVjRGyWINDogIQco4AVQXP-xfNMWNE32MW4ngEOlghglXgsgHa19/s640/Image2.png" width="640" /></a></div>
<br />
In this instance we can see that application code is located in C:\Packages. This file also contains the information of business database location.<br />
<br />
<b>Folder Structure:</b><br />
Following diagram highlights the structure of package directory in AX7.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsyw3hdKb0sfrHpWjCaccfDNp2tSfoc1GWot6oyWyAehUBoQ0JFmDoU5F-RqawtoU5bZ9WM91kUxNazGvzFn0Az1Ps1S8OidtcA5B0xWk-Cu435cjkeYYaAmk1Yhj0p1K4Av2Cjx0Ff4yR/s1600/AX7_Packages_DirectoryStructure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsyw3hdKb0sfrHpWjCaccfDNp2tSfoc1GWot6oyWyAehUBoQ0JFmDoU5F-RqawtoU5bZ9WM91kUxNazGvzFn0Az1Ps1S8OidtcA5B0xWk-Cu435cjkeYYaAmk1Yhj0p1K4Av2Cjx0Ff4yR/s640/AX7_Packages_DirectoryStructure.png" width="640" /></a></div>
<br />
<br />
<ul>
<li>Application code consists of many packages including the standard ones that Microsoft shipped (ApplicationFoundation, ApplicationPlatform, ApplicationSuite, Calendar etc) and any custom packages. </li>
<li>In individual package folder, a folder named "Descriptor" is present. This holds the information of the package, the packages it references and the modes that are part of this package. The file is in XML format.</li>
<li>Each package consists of one or more models (Model 1, Model 2...Model n). </li>
<li>In the model folder (Model 1 in the above screenshot) there is a folder for each AX object type (AxClass, AxEDT, AxTable etc).</li>
<li>The information (code etc) for individual objects is stored in a XML file (shown from FleetManagment package in the above screenshot).</li>
</ul>
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com1tag:blogger.com,1999:blog-6152784823081213380.post-63662915711142208562015-12-31T19:00:00.000+00:002016-01-03T19:04:49.751+00:00Bulk disable of indexes Recently we did some performance assessment of our system using DynamicsPerf and identified unused indexes. Some of these indexes were heavily updated but were not used. So a decision was made to disable these indexes. The indexes were in a csv file (in the format tableName, indexName).<br />
<br />
Following script was used to disable the indexes instead of manually doing the task. As we use source control, the script checks if the table is in source control and if so, it checks it out before disabling it. If not it adds the table to source control after disabling the index. It also creates a private project with all the affected tables added to it. DB synchronization will have to be done manually.<br />
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis7R05VmUHZE3fkN6Glv4NDhSSLo8jgzRGLhUBFB9FN-bsZGsVofGF2SjxS_R-OpXy3s81vmoGtr1dacG9migey4RWD9RaPEPmn5jASyvlCNeaeEHnXww2OOQZEIwQXwZ1YVeEvGNZi7oY/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> static void readAndDisableIndexes(Args _args)
{
#AOT
#File
#SysVersionControl
TreeNodePath path;
TextIo file;
container data;
FileIOPermission permission;
int totalTableAdded, totalIndexesDisabled;
str fileName = 'C:\\Temp\\UnUsedIndex.csv';
Set set = new Set(Types::String);
Set setAddedToVS = new Set(Types::String);
boolean inVS;
boolean vcsEnabled = SysVersionControlParameters::isVCSEnabled();
UtilElements currUtilElement;
IdentifierName tableName, indexToDisable;
IdentifierName projectName = 'MSPerfPorject';
ProjectSharedPrivate projectType = ProjectSharedPrivate::ProjPrivate;
ProjectNode projectNode = SysTreeNode::getPrivateProject().AOTfindChild(projectName);
SysVersionControlSystem vcsSys = VersionControl.parmSysVersionControlSystem();
ProjectNode createProject(IdentifierName _projectName, ProjectSharedPrivate _projectType)
{
ProjectNode projectNodeLoc = SysTreeNode::getPrivateProject().AOTfindChild(_projectName);
info(strFmt('Project name : %1', _projectName));
if (projectNodeLoc)
{
projectNodeLoc.AOTdelete();
info('Project deleted as it already existed.');
}
projectNodeLoc = SysTreeNode::createProject(_projectName, _projectType);
info('Project created.');
return projectNodeLoc;
}
void addTableToProject(ProjectNode _projectNode, IdentifierName _tableToAddName)
{
_projectNode.addUtilNode(UtilElementType::Table, _tableToAddName);
info(strFmt('Table added: %1', _tableToAddName));
}
boolean checkoutIfInVS(SysVersionControlSystem _vcsSys, UtilElements _utilElement)
{
boolean ret = false;
TreeNode treeNode;
SysVersionControllable controlable;
treeNode = SysTreeNode::findNodeInLayer(_utilElement.recordType, _utilElement.name, _utilElement.parentId, currUtilElement.utilLevel);
controlable = SysTreeNode::newTreeNode(treeNode);
if(!_vcsSys.allowCreate(controlable))
{
ret = true;
_vcsSys.commandCheckOut(controlable);
info('Table checked out as it is part of VCS.');
}
return ret;
}
void addToVS(SysVersionControlSystem _vcsSys, UtilElements _utilElement)
{
TreeNode treeNode;
SysVersionControllable controlable;
treeNode = SysTreeNode::findNodeInLayer(_utilElement.recordType, _utilElement.name, _utilElement.parentId, currUtilElement.utilLevel);
controlable = SysTreeNode::newTreeNode(treeNode);
if(_vcsSys.allowCreate(controlable))
{
_vcsSys.commandAdd(controlable);
info('Table added to VCS.');
}
}
void disableIndex(IdentifierName _tableName, IdentifierName _indexNameSQL)
{
DictIndex dictIndex;
DictTable dictTable = new DictTable(tableName2id(_tableName));
int counter;
if(dictTable)
{
counter = dictTable.indexNext(counter);
while (counter)
{
dictIndex = dictTable.indexObject(counter);
if(dictIndex.enabled() && dictIndex.name(DbBackend::Sql) == _indexNameSQL)
{
dictIndex.modify(false, dictIndex.allowDuplicates(), false);
info(strFmt('Disabled index : %1 - %2', dictIndex.name(), _indexNameSQL));
}
counter = dictTable.indexNext(counter);
}
}
}
// project initialisation
projectNode = createProject(projectName, projectType);
projectNode.lockUpdate();
// file operations
permission = new FileIOPermission(fileName, #io_read);
permission.assert();
file = new TextIO(fileName, #io_read);
file.inFieldDelimiter(",");
//Read file
While (file.status() == IO_Status::Ok)
{
data = file.read();
if (conlen(data))
{
inVS = false;
tableName = conPeek(data, 1);
indexToDisable = conPeek(data, 2);
// check and add table to project
currUtilElement = xUtilElements::find(UtilElementType::Table, tableName);
path = xUtilElements::getNodePath(currUtilElement);
if(!set.in(path))
{
addTableToProject(projectNode, tableName);
set.add(path);
if(vcsEnabled)
{
inVS = checkoutIfInVS(vcsSys, currUtilElement);
}
}
// Make the change
disableIndex(tableName, indexToDisable);
// if not in VS Add to Version Control
if (vcsEnabled && !inVS && !setAddedToVS.in(tableName))
{
addToVS(vcsSys, currUtilElement);
}
setAddedToVS.add(tableName);
}
}
// Save the project
projectNode.unlockUpdate();
projectNode.AOTsave();
projectNode.AOTrestore(true);
// Close file
file = Null;
CodeAccessPermission::revertAssert();
info('Finished process.');
}
</code></pre>
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-42136476854948694012015-12-30T18:00:00.000+00:002015-12-31T21:07:19.592+00:00AX7 Technical Changes SummaryWith the AX 7, Microsoft Dynamics AX have been changed in such a manner that it can truly be classed as a brand new platform. On the function side, the changes are minimal (only the required changes to run the features on this new platform).<br />
<br />
In today's post, we'll look briefly at what is changed from technical perspective.<br />
<br />
<b>Client</b><br />
The win 32 rich client is replaced with a browser (IE, Edge, Chrome, Safari).<br />
<br />
<b>AOS</b><br />
Replaced with the ASP.Net web application running on an IIS.<br />
<br />
<b>Batch</b><br />
If the AOS is gone, how my batches will run? Well a new windows service will perform this task.<br />
<br />
<b>MorphX</b><br />
This is replaced with Visual Studio. Extensions have been added to VS to deal with model management, code compile and build. The compilation can either be done from VS or using a standalone tool xppc.<br />
<br />
<b>XPP</b><br />
XPP stays as it is (on the surface). Under the hood there is no p-code, no interpreter. The compile now results in CIL. The unit of compile is the object itself. What does this means? Before AX7 if a method of a class fails to compile, other methods were still usable. IN AX7 the whole class's compilation will fail. There are a lot of other enhancements to XPP. <a href="http://blogs.msdn.com/mfp/default.aspx" target="_blank">MFP's blog</a> is the best place to find out what these are.<br />
<br />
<b>AOT</b><br />
AOT is visible from VS in a read-only mode and is called "Application Explorer". It is available in "Classic view" and "Model View". The object location have changed for some of the objects (EDT, classes etc.) and these are now grouped with similar objects.<br />
<br />
<b>Model Store</b><br />
Model store is no more in the database. The AX application code is stored in the files on disk in XML format.<br />
<br />
<b>Model</b><br />
The concept of model is same as previous versions i.e. a group of objects that typically can be distributed.<br />
<br />
<b>Package</b><br />
New concept in AX7. A package can consist of one or more models and is a used for deployment/compilation of these models. Each package have its own folder. Inside the package folder model folders exist.<br />
<br />
<b>VS Solution</b><br />
A VS solution is a collection of projects. The solution information is not saved in the packages/models.<br />
<br />
<b>VS Project</b><br />
A VS project is a group of objects that are related. A VS solution can have more than one VS project. Similar to VS solution, the project information is not saved in the packages/models. A VS project can only belong to one Model. Projects can be exported as .axpp file and imported on other AX7 installations.<br />
<br />
<b>Debugging</b><br />
There is no standalone debugging application. VS is used for debugging. To start debugging a start-up project and start-up object must be specified.<br />
<br />
<b>Build</b><br />
A single project, model or a set of models can be build. The option to synchronise database is available as part of the build process.<br />
<br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com3tag:blogger.com,1999:blog-6152784823081213380.post-44683789126374730462015-12-22T18:00:00.000+00:002015-12-23T17:29:30.683+00:00Read/Write Excel files from AOS using OpenXML Read/write of Excel files on the client tier is well documented and it often requires Office to be installed on the machine. There are wrappers available in AX as well. However if you want to do the same operations on the server tier, options are limited. And as most administrators don't want to install office on the AOS, this further limits the options available.<br />
<br />
One solution it to use Office OpenXML SDK. Microsoft has already added the required DLLto AX and can be found in References node in the AOT as shown below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilP9OgaITxzIkRIH2T9X7TnrslebEA8QKIimdugzfg_t4THki0bd30KjJW2hR4G5dpV3GdS3Ey7fxDfpEvjHYK4LMt6OGZFDeuEOMvx2XpeJqIF6_M1mHnc6ZFJiQfjpWQBzcztTK1nq4q/s1600/Image+a1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="67" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilP9OgaITxzIkRIH2T9X7TnrslebEA8QKIimdugzfg_t4THki0bd30KjJW2hR4G5dpV3GdS3Ey7fxDfpEvjHYK4LMt6OGZFDeuEOMvx2XpeJqIF6_M1mHnc6ZFJiQfjpWQBzcztTK1nq4q/s320/Image+a1.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
There are wrapper classes around this DLL as well.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZYeMS6aV2UUbdmHlpVC-sCrGvNJKOzlmcIJuJguCjwcSDOJVktwOB3wTs-UTQ-gC5yA0_kDCeSiuRhkG5Xn4ip2CyWFFVfgThkRIQRFbDpRe67O0Sz9GciObWxBcUR9twQwLSvh_GS8jq/s1600/Image+a2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="109" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZYeMS6aV2UUbdmHlpVC-sCrGvNJKOzlmcIJuJguCjwcSDOJVktwOB3wTs-UTQ-gC5yA0_kDCeSiuRhkG5Xn4ip2CyWFFVfgThkRIQRFbDpRe67O0Sz9GciObWxBcUR9twQwLSvh_GS8jq/s320/Image+a2.png" width="320" /></a></div>
<br />
As you can see from the name suffix these classes were written for Russian localisation. They work very well on the client tier. However on the server tier these classes have an issue as these uses methods from another class "ComExcelDocument_RU" which is marked to run on Client. Hence any use of these classes on server tier will result in error.<br />
<br />
An easy work around is to copy the methods to the class OXMLSpreadsheetDocument_RU and replace ComExcelDocument_RU with OXMLSpreadsheetDocument_RU in the rest of classes. Below is screenshot of modified class.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfrzk6YegZNFBLxaw9Tr1eWRLeo4fRts_ZavPVvFTJmsQsnzY_KastWry2o0wFbgntOKUvdd69AsOgWAAtWlfi_NlkG6K8idJwBbO28YZzKkwiJG0RSkH2S3xXRuMI-1TbggjANZo4ygSG/s1600/Image+a3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="208" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfrzk6YegZNFBLxaw9Tr1eWRLeo4fRts_ZavPVvFTJmsQsnzY_KastWry2o0wFbgntOKUvdd69AsOgWAAtWlfi_NlkG6K8idJwBbO28YZzKkwiJG0RSkH2S3xXRuMI-1TbggjANZo4ygSG/s320/Image+a3.png" width="320" /></a></div>
<br />
Once changed, these classes can be used on the server tier.<br />
<br />
<b>Note: </b>In AX 2012 R2 (and possibly in other versions) the class OXMLSpreadsheetDocument_RU only opens an excel file, It does not create one. There are two possible solutions to this.<br />
<br />
1. Modify the class to create a new excel document.<br />
2. Save an empty excel file as a "Resource" in AOT. And every time you need to write data to excel file, save the resource as file and use OXMLSpreadsheetDocument_RU for writing data in it.<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com1tag:blogger.com,1999:blog-6152784823081213380.post-64240624567085977182015-12-21T18:00:00.000+00:002015-12-22T12:50:33.046+00:00Running AX7 VM on Oracle VirtualBoxIn my <a href="http://axbytes.blogspot.co.uk/2015/12/how-to-get-ax-7-vm-to-run-locally.html" target="_blank">previous post</a> I described how to obtain the VM for AX7 CTP8. To run this VM you do not have to use Hyper V, VirtualBox works perfectly as well. In today's post I'll outline the steps required to run this VM in the VirtualBox.<br />
<br />
Once you have downloaded the VM (20 files of almost 20 GB size), double click on the first file.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPzIuHTj1r_jM5ApgRofO8eUy7pAe43eJqGv9WB1l77Ny9nphVMwyIDd6DdHiEGKhAv-Racdh_m-QqM2aQpBuZDMPlhcvSn7sRSvC4IVWnZQR3feyjrvGPWjQSqo6txAXRon25nLGgMm8j/s1600/Image+0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPzIuHTj1r_jM5ApgRofO8eUy7pAe43eJqGv9WB1l77Ny9nphVMwyIDd6DdHiEGKhAv-Racdh_m-QqM2aQpBuZDMPlhcvSn7sRSvC4IVWnZQR3feyjrvGPWjQSqo6txAXRon25nLGgMm8j/s1600/Image+0.png" /></a></div>
<br />
This will ask you the folder where to extract the files. Choose a folder and click Extract. Make sure that the drive where you are extracting the files have at least 120 GB space. More space will be required if you want to save the state of the machine instead of turning it off every time.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3g1o6fO5PD4YMFx604Ne1aLpf3szqbek4SWSCnXMz9puP6m7NDbmiH_jPTagVp5jE0q0XeYBnjb8eSf9ifITsSzysfhB_ydC6Wqe02ckTZdd1-GL1AFJLK2AD8sBuEEmJCvjZwAlQAHYy/s1600/Image+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="313" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3g1o6fO5PD4YMFx604Ne1aLpf3szqbek4SWSCnXMz9puP6m7NDbmiH_jPTagVp5jE0q0XeYBnjb8eSf9ifITsSzysfhB_ydC6Wqe02ckTZdd1-GL1AFJLK2AD8sBuEEmJCvjZwAlQAHYy/s400/Image+1.png" width="400" /></a></div>
<br />
This step will take a while depending on your hardware capabilities. Once done you'll have a single VHD file.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEztQKZeaUmovdIV75K17tm5je9MsEyxq0p5IyPaHVqbaP3j7xDQhlQ7Q3n2k_h_o534z3GQs-alV4V-f682_mossxr0n_sjx4uWZfh_KEFOpODYg3rwAMg9xzJbJFK8AB28vGGYamaz7I/s1600/Image+4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="32" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEztQKZeaUmovdIV75K17tm5je9MsEyxq0p5IyPaHVqbaP3j7xDQhlQ7Q3n2k_h_o534z3GQs-alV4V-f682_mossxr0n_sjx4uWZfh_KEFOpODYg3rwAMg9xzJbJFK8AB28vGGYamaz7I/s640/Image+4.png" width="640" /></a></div>
<br />
Open VirtualBox and click on New button.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS7XKUemSBw0VBAANW3JpFyoo4puvPlVRlyqyF8dVp7MCEwcIvy3K_8F6hE5GmoH9apu3h0096JaB8mAZ5WcuKjhxChdjOW47PTegfD_tDuFxrSESLxcaj_6re7X0rREatHfb0phym2MVh/s1600/Image+5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="58" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS7XKUemSBw0VBAANW3JpFyoo4puvPlVRlyqyF8dVp7MCEwcIvy3K_8F6hE5GmoH9apu3h0096JaB8mAZ5WcuKjhxChdjOW47PTegfD_tDuFxrSESLxcaj_6re7X0rREatHfb0phym2MVh/s200/Image+5.png" width="200" /></a></div>
<br />
Name the virtual machine and choose windows OS as shown below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPHULgsbMvxwABT5m4F45fKdzfycAwo_SaEK_8fu-NhXrpyME1DFHVlRxsBT_NvWuucQQ4lj4snA_0Zf0VIm6bz4Q0Ir2JfGrvwga-xq4NPO3SMhrbH7vjCNYgZdvhKs67FYbAxZficXe_/s1600/Image+6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPHULgsbMvxwABT5m4F45fKdzfycAwo_SaEK_8fu-NhXrpyME1DFHVlRxsBT_NvWuucQQ4lj4snA_0Zf0VIm6bz4Q0Ir2JfGrvwga-xq4NPO3SMhrbH7vjCNYgZdvhKs67FYbAxZficXe_/s400/Image+6.png" width="400" /></a></div>
<br />
Click on Next and choose RAM. MS recommends having a VM of at least 16 GB RAM. In my test machine I could only give it 6 GB, it was slow but not very slow.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3DB_uEGxVRKvDfL2qiQ-LBZwtabsS7kSgok2ymA6N6Gnq6xj5a7gmDvXm47mzZdEdKbO2UmyOAJtN8z8uEOLQBWmO85NY8nAHDte45u_eu7BjBInWA9zmIrwgR1H7eBxN4DAJ49QBnMlL/s1600/Image+7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="341" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3DB_uEGxVRKvDfL2qiQ-LBZwtabsS7kSgok2ymA6N6Gnq6xj5a7gmDvXm47mzZdEdKbO2UmyOAJtN8z8uEOLQBWmO85NY8nAHDte45u_eu7BjBInWA9zmIrwgR1H7eBxN4DAJ49QBnMlL/s400/Image+7.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Click Next and choose the extracted VHD,</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1eqGp_s4ztxtC5XlU2phhe3U9EVCqJ9RGGo5yhwAKZ2gJcBG2fCvWFDySI5eX02yosuyyUao3GoPb3ZbhSetqkR0keW7JwNjMLOPzVQpcpsrT0eNl8FvDuHi23ReV02AH1j0NXU0L0Zs7/s1600/Image+8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="338" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1eqGp_s4ztxtC5XlU2phhe3U9EVCqJ9RGGo5yhwAKZ2gJcBG2fCvWFDySI5eX02yosuyyUao3GoPb3ZbhSetqkR0keW7JwNjMLOPzVQpcpsrT0eNl8FvDuHi23ReV02AH1j0NXU0L0Zs7/s400/Image+8.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Clicking on Create will create the VM. Before starting the VM, click on the Settings and change the number of CPUs as shown below. More CPU the better it will be.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW7M8ixEH-g9AV1cZ9viyQkwU8kHHM_iIe9nQZ-8zng2HexAWxXcWOTYQiFTgDcD4J7khbVWN7pa-iYKxZ87I0tZxPQAHHsu5zEj1q7ZcPEoOilvM-zeu8YgTbImfmqdPLrSONQvbGKBSo/s1600/Image+9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="281" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW7M8ixEH-g9AV1cZ9viyQkwU8kHHM_iIe9nQZ-8zng2HexAWxXcWOTYQiFTgDcD4J7khbVWN7pa-iYKxZ87I0tZxPQAHHsu5zEj1q7ZcPEoOilvM-zeu8YgTbImfmqdPLrSONQvbGKBSo/s400/Image+9.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The network on a VirtualBox VM is by default configured using NAT as shown below so no special setup is required here.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3cDnQcaVdopyBfsQXfoSlEgRTg5Yvs6QpKG4qAtNu-IGcy5MTeDoq3VbEqGCLr9QNinl6t5E6p9t39ffc3YvUnNav0E1enr_B6ZddTc7Nc7qShKgyqZ_NrS9iyM4WOyGuI8tj6arRQtMI/s1600/Image+10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3cDnQcaVdopyBfsQXfoSlEgRTg5Yvs6QpKG4qAtNu-IGcy5MTeDoq3VbEqGCLr9QNinl6t5E6p9t39ffc3YvUnNav0E1enr_B6ZddTc7Nc7qShKgyqZ_NrS9iyM4WOyGuI8tj6arRQtMI/s400/Image+10.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now the VM can be started. Once started, on the the login page you'll see the familiar Windows 2012 credentials screen. The famous MS password for the VM Administrator account can be used to login.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY_OAlreG4ELB9OowUmNOoVyFmYLxy7E_wRASZrOP6-TSBdDp_KifNJl5oIml2tdgpGcGWDR41oA2zXvl58OYGH8XrhrTxw1cMvj3_O4uHUM7ng-lvkepW1BlGLizSb-LUF1jP19yVL0BM/s1600/Image+10a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="134" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY_OAlreG4ELB9OowUmNOoVyFmYLxy7E_wRASZrOP6-TSBdDp_KifNJl5oIml2tdgpGcGWDR41oA2zXvl58OYGH8XrhrTxw1cMvj3_O4uHUM7ng-lvkepW1BlGLizSb-LUF1jP19yVL0BM/s320/Image+10a.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Once logged in, open IE and click in the address bar. Here the AX7 link should automatically appear (highlighted below) as it was used previously when MS created the VM.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg73CEaSc7NcUJEjqRygJMV1zyEI-BVCD9gKjycjwMT-IibOaQ5h5CaEjrpRTRmFePCwotMwYcU5sAowWZI6DMnYXGguYHZVF_W6IMq3IRwtkmDqnTYqybKEydnefaB1rW218NcIL4wb_9s/s1600/Image+11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="85" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg73CEaSc7NcUJEjqRygJMV1zyEI-BVCD9gKjycjwMT-IibOaQ5h5CaEjrpRTRmFePCwotMwYcU5sAowWZI6DMnYXGguYHZVF_W6IMq3IRwtkmDqnTYqybKEydnefaB1rW218NcIL4wb_9s/s400/Image+11.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Once clicked, it will navigate to the Sign in page.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia8kDTL7J0674GzxRHst-pYeAYYgYDlqH77oeVCfEmRSbwTUKFv4sBFnx0AJwiev-d2pqBlJuX5Ec-N0Kn8rZrb4puiUDJfz3LoQayobYpl991bo0Oj2IbHeupv5oOrQ4iMZyDktsSBq8-/s1600/Image+11a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="254" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia8kDTL7J0674GzxRHst-pYeAYYgYDlqH77oeVCfEmRSbwTUKFv4sBFnx0AJwiev-d2pqBlJuX5Ec-N0Kn8rZrb4puiUDJfz3LoQayobYpl991bo0Oj2IbHeupv5oOrQ4iMZyDktsSBq8-/s320/Image+11a.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The password for this is mentioned on the AX 7 Sign Up page on Customer/Partner source. After entering the password, AX 7 opens up.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsA2A091tQj6MxEu2YBkna2tCjn4HwAhm9vDu1q_XeLGerKdwVBfRuoHhnCL5M_xoIkYu1vlk-nYULrBBSiFefGsiUVz7V8mGWp3wHgRXPy6678Q-U0wlq2HeqVf61dcExNNM4eAFI0tZF/s1600/Image+12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="227" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsA2A091tQj6MxEu2YBkna2tCjn4HwAhm9vDu1q_XeLGerKdwVBfRuoHhnCL5M_xoIkYu1vlk-nYULrBBSiFefGsiUVz7V8mGWp3wHgRXPy6678Q-U0wlq2HeqVf61dcExNNM4eAFI0tZF/s400/Image+12.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
As my test machine was not very powerful, I initially got an error (I assume not everything was started), however after some time when I came back to this page and refreshed it, it worked fine.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span></div>
Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com18tag:blogger.com,1999:blog-6152784823081213380.post-17667587605306024172015-12-20T18:00:00.000+00:002015-12-20T18:11:02.159+00:00How to get AX 7 Technical Preview VMCouple of days ago "Microsoft Dynamics AX" public preview went live. <a href="https://twitter.com/satishthomas" target="_blank"><span style="color: #8899a6; font-family: "arial" , sans-serif;"><span style="background: rgb(245, 248, 250); font-size: 14px; line-height: 14px;">@</span></span><span class="u-linkComplex-target" style="background: rgb(245, 248, 250); color: #8899a6; font-family: "arial" , sans-serif; font-size: 14px; line-height: 14px; text-decoration: none !important;">satishthomas</span></a> from Microsoft blogged more info on this (<a href="https://medium.com/@satishthomas/the-new-microsoft-dynamics-ax-public-preview-is-now-live-269ab115be56#.uj667n4lh" target="_blank">link</a>). In summary following needs to be done to get it going<br />
<br />
1. For customer source use this <a href="https://mbs.microsoft.com/customersource/global/AX/news-events/news/Microsoft_Dynamics_AX_Public_Preview" target="_blank">link</a> and for partner source use this <a href="https://mbs.microsoft.com/partnersource/global/news-events/news/Microsoft_Dynamics_AX_Public_Preview%C2%A0%E2%80%A6" target="_blank">link</a>.<br />
2. Login using either customer or partner source credentials.<br />
3. Once logged in scroll down and you'll see a small paragraph as shown below<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcRlILhUqcq7Y077tac23hBUtMBroHCsMLpU8BaGMhmt1ZYJ19ytmEN_BQEYDLbHCRgnFZeOIPRw0H_fcLUVHNlci9UDKWCU_mj5E9X5jdL6WHTIW9M91WXCWcN2F5n7aKRZIjjC4otIkR/s1600/Image+01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcRlILhUqcq7Y077tac23hBUtMBroHCsMLpU8BaGMhmt1ZYJ19ytmEN_BQEYDLbHCRgnFZeOIPRw0H_fcLUVHNlci9UDKWCU_mj5E9X5jdL6WHTIW9M91WXCWcN2F5n7aKRZIjjC4otIkR/s1600/Image+01.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
Clicking on the highlighted part will get you going on signing up for the preview. More details on these steps can be found on Satish's blog.<br />
<br />
However if you want to get a VM to run it locally, you'll have to take some additional steps. Once you have signed up for the preview, come back to the sign up page on customer/partner source and scroll further down in the FAQ section and find the feedback question as shown below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnJyD6WJvEnxbgts4WMXZHoYOW8U0T7N0VH8zuOhzKvsGU4i_ooR98oEXztCxX7eRx_wmRn7HwFNWHwTVuww9Sku7PJgeSunYtXBu_V5wyrNzV7OZ2bm865cN4Ub73QngVXPW5RME-sXSq/s1600/Image+0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="233" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnJyD6WJvEnxbgts4WMXZHoYOW8U0T7N0VH8zuOhzKvsGU4i_ooR98oEXztCxX7eRx_wmRn7HwFNWHwTVuww9Sku7PJgeSunYtXBu_V5wyrNzV7OZ2bm865cN4Ub73QngVXPW5RME-sXSq/s640/Image+0.png" width="640" /></a></div>
<br />
Clicking on the link will take you to Connect site where you'll be automatically added to preview program. There you'll see a download section as shown below<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifLoaWnVhwXzXkJ1AuZzvyyEC-uLDDW5lbtE-MYCoIQBPgFMg744zQstzdXx6SqMIbv-kUPxbzZXWjf-L8W5QThwnYyU3qeMK482wruAdSR_Nc5URE5Ewr5c6d29Hi-zM9FDY_ccHcjWFj/s1600/Image+02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="122" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifLoaWnVhwXzXkJ1AuZzvyyEC-uLDDW5lbtE-MYCoIQBPgFMg744zQstzdXx6SqMIbv-kUPxbzZXWjf-L8W5QThwnYyU3qeMK482wruAdSR_Nc5URE5Ewr5c6d29Hi-zM9FDY_ccHcjWFj/s400/Image+02.png" width="400" /></a></div>
The download section will contain the link to download the preview VM<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOOQ81IkTlfxEaZXtwFgZF_E2BTVjR3NN5Y8SfzTZEBboYUphyphenhyphenMdHbFA4IGLt1fe-hfllDlpfclDqAPDRy42QpcOgnJZi30duLeko1ASXmf9Fo-E8WDsoNiGDziqqwtZeNE_sMct38JzWr/s1600/Image+03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="126" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOOQ81IkTlfxEaZXtwFgZF_E2BTVjR3NN5Y8SfzTZEBboYUphyphenhyphenMdHbFA4IGLt1fe-hfllDlpfclDqAPDRy42QpcOgnJZi30duLeko1ASXmf9Fo-E8WDsoNiGDziqqwtZeNE_sMct38JzWr/s400/Image+03.png" width="400" /></a></div>
<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com2tag:blogger.com,1999:blog-6152784823081213380.post-57462616675761726232015-12-18T18:00:00.000+00:002015-12-20T17:44:35.570+00:00AX 7 Help Wiki availableHelp wiki is now available for technical preview of new "Microsoft Dynamics AX" aka AX 7. It can be accessed from the following link<br />
<br />
<a href="https://ax.help.dynamics.com/en/">https://ax.help.dynamics.com/en/</a><br />
<br />
The wiki details how to sign up for AX 7, get an instance running either in cloud or get a vhd to run locally, technical changes and a lot more.<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-23130647750996347362015-04-17T18:00:00.000+01:002015-04-23T13:16:04.724+01:00Caching display methodsA display method is usually used to fetch data from another source or to perform calculations. It is recommended to create them on Tables. Once these display methods are used on forms, these are called every time the form is re-drawn. However if the field/group/tab which uses this method is hidden the display method is not called. For performance reasons the display method should be cached. This way system calls the method once and stores its values reducing unnecessary calls to server.<br />
<br />
Recently we had a performance issue and on investigation found out that apart from the actual cause of problem, some display methods are not cached. So we followed the recommendations and cached the methods using attribute [SysClientCacheDataMethodAttribute(true)].<br />
<br />
Every thing was fine until a user complained about performance using a specific customer. We investigated again and found out that one of the display method that we cached in previous findings is causing the issue. It had a IF condition and was doing some heavy calculation in certain cases only. But why this was not a problem before. On further investigation we found that the field on form which was using this display method was hidden. So when the display method was not cached it was not called by system.<br />
<br />
However after caching it, upon opening of the form, system was calling the following method<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code><Table Name>::executeCachedDisplayMethods
</code></pre>
This method was calling all the cached display methods of the table regardless of whether the field for the display method is hidden or not. This behavior is different from when the display method is not cached.<br />
<br />
Our solution to problem was to remove the hidden field from the form.<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-46388087867982744782015-04-03T18:00:00.000+01:002015-04-23T12:40:34.529+01:00Connect to a desired AOS in load balanced AOSsIf you have a set of clustered AOS and you want to connect a specific AOS, use the following command line parameters<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>AX32.exe -loadbalance=0 -aos2=<AOS SERVER NAME>:<AOS PORT>
</code></pre>
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-88149735558909941472015-03-02T18:00:00.000+00:002015-03-03T17:36:06.255+00:00.NET Cast Type Name not found errorLast week I was trying to fix a bug in custom code where we import the POs. The bug was in the following method.<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>protected AnyType getData(int _position, Container _data = currentData)
{
str data = conpeek(_data, _position);
data = strRem(data,'"');
if( _position == str2int(#13)
|| _position == str2int(#14))
{
data = this.formatDate(data);
}
return data;
}</code></pre>
The fix for the bug was to check for another position #07 and convert the data to date format. So I changed the code to following<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>protected AnyType getData(int _position, Container _data = currentData)
{
str data = conpeek(_data, _position);
data = strRem(data,'"');
if( _position == str2int(#13)
|| _position == str2int(#14)
|| _position == str2int(#07))
{
data = this.formatDate(data);
}
return data;
}
</code></pre>
Note the position of #07 in the if statement. The compile was fine however when I generated IL it gave the following error. Incremental or full IL, both produced the same error.<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>CIL generation: Error: .NET Cast Type Name not found. Type System.String found on the stack. This code in Class/Table: POImportService, Method: getData may not work in CIL run time.
</code></pre>
I moved the position of #07 as shown below and the error disappeared.<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>protected AnyType getData(int _position, Container _data = currentData)
{
str data = conpeek(_data, _position);
data = strRem(data,'"');
if( _position == str2int(#07)
|| _position == str2int(#13)
|| _position == str2int(#14))
{
data = this.formatDate(data);
}
return data;
}
</code></pre>
Not sure why IL does not like the #07 line to be the last one.<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-58666139300516797272015-02-18T18:00:00.000+00:002015-02-19T14:39:59.928+00:00Trace Parser command line paramtersIf you want to automate trace file open/import, Trace Parser supports command line parameters.<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>Usage: Microsoft.Dynamics.AX.Tracing.TraceParser.exe [options]
/log=[filename] - Used to log messages t the specified file.
/register - Register a new or existing database. Options:
/server=[hostname] - Name of the SQL Server. Default to localhost.
/database=[database] - Name of the SQL Database
/(open|import)=[filename] - Imports a Trace File. Options:
/id=[id] - TraceId if the file is already imported.
/consoleonly - Run in console only.</code></pre>
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-31618513801701381562015-02-09T18:00:00.000+00:002015-02-10T12:03:39.489+00:00Phantom objects in USR layer after compile using AXBuildRecently we performed a cleanup of USR layer and moved the objects (created wrongly in that layer) to CUS layer or removed them if they were not required as we are supposed to have nothing in USR layer. We then removed the USR model using AXUtil. This went well until we noticed that there are some objects in USR layer. These included some classes and forms. Recompiling was bringing these objects back even if we remove these.<br />
<br />
Examining these objects, we found that none of these have any difference from the layer below. These phantom objects were created while the application was compiled using AXBuild. A client compile was not creating these phantom objects.<br />
<br />
So we contacted MS and were advised to apply KB 3015739 which is a binary hotfix. This however did not fix our issue. One of my colleague later discovered that if we pass an additional <a href="https://msdn.microsoft.com/en-us/library/dn528954.aspx" target="_blank">un-documented parameter</a> <b>/layer=cus</b> to AXBuild, these phantom objects are not created.<br />
<br />
Not sure if this parameter was present before or it was introduced due to the KB that we applied but it fixed out issue.<br />
<br />
We are on AX2012 R2 with CU7.<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com2tag:blogger.com,1999:blog-6152784823081213380.post-87491004369766864552015-02-04T18:00:00.000+00:002015-03-08T18:40:49.240+00:00Report error in Dynamics AXWe had the following error while users were trying to print reports from AX.<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:queryBuilderArgs. The InnerException message was 'Element 'http://tempuri.org/:queryBuilderArgs' contains data from a type that maps to the name 'http://schemas.datacontract.org/2004/07/XppClasses:SrsReportProviderQueryBuilderArgs'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'SrsReportProviderQueryBuilderArgs' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details.
</code></pre>
The problem goes away if you point the SSRS to another AOS through the AX client configuration or by restarting the AOS.<br />
<br />
<span style="font-size: x-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-28209199747143938702015-01-29T18:00:00.000+00:002015-01-30T17:53:22.584+00:00PowerShell script for starting AX Perfmon event trace remotelyIn my previous <a href="http://axbytes.blogspot.co.uk/2015/01/start-ax-perfmon-event-trace-remotely.html" target="_blank">post </a>I talked about starting AX Perfmon trace remotely. Attached to this post is the PowerShell script that does the same. The stop step also copies the trace generated to a network folder. Instead of starting the script in PowerShell and specifying parameters, I have created a shortcut for each operation on an AOS server. So from a remote machine, trace can be generated and can be loaded from the network folder for analysis.<br />
<br />
The script folder have following files<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvsDxiX1wrsxodBOeHvdZ_Xtstm8urZ-0ACp3q2f-1JpSwBtTZ2sz7t0OnfsLg1UJ5jOZVf1QTUrnieScr0ibMJGi4chtudSOpXjfhhyQKQV3YNQOP26XahZPlO2686pOC8RI-toUQx65i/s1600/AXTraceFiles.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvsDxiX1wrsxodBOeHvdZ_Xtstm8urZ-0ACp3q2f-1JpSwBtTZ2sz7t0OnfsLg1UJ5jOZVf1QTUrnieScr0ibMJGi4chtudSOpXjfhhyQKQV3YNQOP26XahZPlO2686pOC8RI-toUQx65i/s1600/AXTraceFiles.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b>StartStopTrace.ps1: </b>This is where the actual PoweShell code resides.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Parameters.txt</b>: Parameters file to specify the data collector set name, destination folder to copy trace and the source path of trace as shown below </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik3dABcmG9w8FetrSpmDvDCybJHjJNM8-qo8OvHfbGsvbpEX3LjoAKKlADlw48vxnkchgL1cIq8-kLxhdQ6R0MG02T58OYWA3TmJv3vygPx1rH2KDcBno-jU3HANG-JuTEVTwGOrOqjOvp/s1600/AXTraceParameters.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik3dABcmG9w8FetrSpmDvDCybJHjJNM8-qo8OvHfbGsvbpEX3LjoAKKlADlw48vxnkchgL1cIq8-kLxhdQ6R0MG02T58OYWA3TmJv3vygPx1rH2KDcBno-jU3HANG-JuTEVTwGOrOqjOvp/s1600/AXTraceParameters.PNG" height="46" width="320" /></a></div>
<b>AXTraceTemplate.xml</b>: This is the template to create data collector set on new AOS servers. This already have the recommendations suggested in original MS <a href="http://blogs.msdn.com/b/axperf/archive/2011/11/18/collect-ax-2012-event-traces-with-windows-performance-monitor.aspx" target="_blank">blog</a>.<br />
<br />
<b>AOS 1 Start Trace shortcut: </b>Use to start trace on AOS 1. The value of "Target" property of the short cut contains<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File .\StartStopTrace.ps1 -Operation Start -Server AXPROD-AO1</code></pre>
<b>AOS 1 Stop Trace shortcut:</b> This is similar to start shortcut except the operation is stop.<br />
<br />
More shortcuts can be created for additional AOS as required.<br />
<iframe frameborder="0" height="120" scrolling="no" src="https://onedrive.live.com/embed?cid=3AA1E8D9B53FD40C&resid=3AA1E8D9B53FD40C%2145255&authkey=AIYZxzAZTloF1FA" width="98"></iframe>
<br />
<span style="font-size: xx-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0tag:blogger.com,1999:blog-6152784823081213380.post-12286861870971800392015-01-27T18:00:00.000+00:002015-01-28T17:54:03.534+00:00Start AX Perfmon event trace remotelyThere are several ways to create traces in AX2012 for performance monitoring/optimization. One of these is by using Windows Performance Monitor. Details of how to do this can be found <a href="http://blogs.msdn.com/b/axperf/archive/2011/11/18/collect-ax-2012-event-traces-with-windows-performance-monitor.aspx" target="_blank">here</a>.<br />
<br />
As this trace is configured on the AOS, so to start the trace you'll have to log in to the AOS. Use the following command to do this remotely.<br />
<br />
<b><u>Start Trace</u></b><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>logman.exe Start "<DATA_COLLECTOR_SET_NAME>" -S <SERVER_NAME></code></pre>
<b><u>Stop Trace</u></b><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>logman.exe Stop "<<span style="font-family: 'Andale Mono', 'Lucida Console', Monaco, fixed, monospace;">DATA_COLLECTOR_SET_NAME</span></code>>" -S <SERVER_NAME></pre>
Double quotes around data collector set name are required only if the it have a space.<br />
<br />
<span style="font-size: xx-small;">This posting is provided "AS IS" with no warranties. Use code at your own risk.</span>Navidhttp://www.blogger.com/profile/10349115103320886696noreply@blogger.com0