Multidimensional array in Microsoft Dynamics AX

So, we had the situation where we needed to use a multidimensional array within AX. AX can only handles a single dimensional array, and using the .NET classes, caused some issues when with type conversions.

Eventually we ended up creating a Class.

The example below creates a 3 dimensional array.

To test, just run the main static method.

class WeightArray3
Map weights;
int size1, size2, size3;

public static WeightArray3 construct(int _size1, int _size2, int _size3)
weightArray3 weightArray = new weightArray3();
return weightArray;

public int parmSize1(int _size1 = size1)
size1 = _size1;


public int parmSize2(int _size2 = size2)
size2 = _size2;

return size2;

public int parmSize3(int _size3 = size3)
size3 = _size3;

return size3;

public void init()
weights = new Map(Types::Real, Types::Integer);

public void setValue(Weight _weight, int _index1, int _index2, int _index3)
int i;
i = ((_index1 – 1) * size2 * size3)
+ ((_index2 – 1) * size3)
+ (_index3 – 1);
weights.insert(i, _weight);

public real getValue(int _index1, int _index2, int _index3)
int i;
real r;
i = ((_index1 – 1) * size2 * size3)
+ ((_index2 – 1) * size3)
+ (_index3 – 1);
r = weights.lookup(i);
return r;

public static void main(Args _args)
WeightArray3 weightArray = WeightArray3::construct(10, 5, 3);
int i1, i2, i3;
int counter = 0;
real r;

for (i1 = 1; i1 <= 10; i1++)
for (i2 = 1; i2 <= 5; i2++)
for (i3 = 1; i3 <= 3; i3++)
counter += 1;
weightArray.setValue(counter, i1, i2, i3);
for (i1 = 1; i1 <= 10; i1++)
for (i2 = 1; i2 <= 5; i2++)
for (i3 = 1; i3 <= 3; i3++)

r = weightArray.getValue(i1, i2, i3);
info(strfmt(‘%1 : %2 : %3 = %4’, i1, i2, i3, r));

Posted in Microsoft Dynamics AX 2012, Uncategorized | Leave a comment

AX2012: Using the Excel add-in, you might receive the error: “The role that you are assigned does not have permission to access the selected data.”

In AX2012, while using the Excel add-in, you might receive the error: “The role that you are assigned does not have permission to access the selected data.”

Cause: A Full CIL or Incremental CIL might be running, causing this error.



Posted in Microsoft Dynamics AX 2012 | Leave a comment

AX2012 – The Complexities of an upgrade

Project managers and clients don’t really understand the complexities of upgrading an environment to a new Roll-up / CU version.  Well, how difficult can it be?  And why can’t it be done right now?

Well, usually it is not a problem.  As a developer you compare your code, if changes were made on existing objects and make sure you merge the new code with your code.  And everyone is happy.

However, what happens when you have other partner products on your AX Environment.  What if those products were build for a different Roll-up / CU version.  Now suddenly it becomes a whole lot more complicated to do the upgrades.

At some of our clients, we have had to merge code over 4 to 5 layers.  You can easily lose your head with a merge, especially with methods that are quite large.

Let me explain this with an example:

On the Class: \Classes\CustVendCreatePaymJournal we’ve create a new variable in the Class Declarations on the CUS Layer.  We’ve also installed a partner product (on the VAR layer), which  also created a new variable in the Class Declarations.  As part of the normal merging process, we made sure we merge the Variable back into the CUS Layer.  Microsoft also created some methods on the class both on the SYS and SYP layers.  All of these changes were done on AX2012 R3 CU8.  Everyone is happy…

We received a request from the client to upgrade to the latest CU version (CU10) ASAP.  We notified the client that not all of the partner products are available on CU10.  Our client told us to still continue with the upgrade.

With the upgrade, Microsoft made some changes the the SYP layer.  As part of the merging process, a developer usually compare the first layer in our case the CUS layer, and the layer just above it, i.e. VAR layer in this example.  However, by doing this we are missing out on any changes that might have occurred on the SYP layer, thus causing compile errors, because the variable for the SYP layer was never linked in the code.

Well, what is the problem then.  Well, in some environments we have code changes in methods that have 100s of lines of code.  You then have to compare your custom code with the changed layer (SYP), compare it with the changes on the ISV, ISP, VAR, VAP layers (and yes we do have clients with these setups).  And finally you have to apply the combined merge on your CUS Layer, which can get quite complicated, especially when the changes were not property commented in code.  remember now, the ISV, ISP, VAR and VAP layers also contain their own code custom code, which was created for an older CU version.  You can not easily identify the SYP changes, because it might actually changes on top of the SYP layer, which will not provide you will a clear indication of the change.

Lesson learned:

Wait for all products / to be upgraded before you try to upgrade your own code to the new Rol-up / CU version.  That way you will not have to try and figure our code changes over multiple layers.


Posted in Microsoft Dynamics AX 2012 | Leave a comment

AX2012 R3 CU8 – AOT Compile Errors on Payroll Classes related to Symmetry DLL


In Microsoft Dynamics AX 2012 R3 CU8, we found 22 errors after running a full compile on the AOT, all related to the Summetry Namespace. After researching the web, and trying all of the solutions offered on other websites, we were still getting exactly the same compile errors.

You can read more about what we have tried on these websites:


Event Log:

The error we received in the event log was:

“The description for Event ID 110 from source Microsoft Dynamics AX cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Microsoft Dynamics AX Business Connector Session 7.
Failed loading assembly ste-net, Version=, Culture=neutral, PublicKeyToken=5542884f620dbde5”

Compiler output:

Severity Path Line Col Error message
Error \Classes\PayrollCalculatePayStatementBenefits\classDeclaration 12 5 Syntax error.
Error \Classes\PayrollCalculatePayStatementTaxes\classDeclaration 42 5 Syntax error.
Error \Classes\PayrollSetup\refreshWorkerTaxRegionTaxes 25 5 Variable Symmetry has not been declared.
Error \Classes\PayrollTaxCalculation\classDeclaration 7 5 Syntax error.
Error \Classes\PayrollTaxEngineUtil\checkInTaxEngine 7 37 Syntax error.
Error \Classes\PayrollTaxEngineUtil\checkOutTaxEngine 7 15 Syntax error.
Error \Classes\PayrollTaxEngineUtil\getGNISLocations 40 5 Variable Symmetry has not been declared.
Error \Classes\PayrollTaxEngineUtil\getMunicipalities 39 5 Variable Symmetry has not been declared.
Error \Classes\PayrollTaxEngineUtil\getPoliticalSubDivision 31 5 Syntax error.
Error \Classes\PayrollTaxEngineUtil\getPoliticalSubDivisionByTaxCode 20 5 Syntax error.
Error \Classes\PayrollTaxEngineUtil\getSchoolDistricts 41 5 Variable Symmetry has not been declared.
Error \Classes\PayrollTaxEngineUtil\getTaxEngineLocationCodeList 38 5 Variable Symmetry has not been declared.
Error \Classes\PayrollTaxEngineUtil\getTaxEngineVersion 10 39 Syntax error.
Error \Classes\PayrollTaxEngineUtil\getTaxTableVersion 10 38 Syntax error.
Error \Classes\PayrollTaxEngineUtil\money2Real 11 40 Syntax error.
Error \Classes\PayrollTaxEngineUtil\real2Hours 11 22 Syntax error.
Error \Classes\PayrollTaxEngineUtil\real2Money 11 22 Syntax error.
Error \Classes\PayrollTaxEngineUtil\real2Rate 11 22 Syntax error.
Error \Classes\PayrollTaxEngineUtil\taxCalculation2TaxCode 11 62 Syntax error.
Error \Classes\PayrollTaxTypeInitialization\classDeclaration 8 5 Syntax error.
Error \Data Dictionary\Tables\PayrollEmployerTaxRegion\Methods\retrieveGNIS 12 5 Variable Symmetry has not been declared.
Error \Data Dictionary\Tables\PrlTmpGNIS\Methods\populatePrlTmpGNIS 13 5 Variable Symmetry has not been declared.

Example Code containing error:

Symmetry.TaxEngine.BenefitInfo benefitInfo401_403;”

“Symmetry.TaxEngine.STEPayrollCalculator             ste;”

“Symmetry.TaxEngine.STEPayrollCalculator             ste;”



Finally we took the DLLs from an environment that worked and copied them to our environment. The Dlls were different, and in size and date.  this solved the problem.

By reinstalling the binaries again from AX2012 R3 CU8 installation file also solved the problem.


Posted in Microsoft Dynamics AX 2012 | 4 Comments

SysDictTable object not initialised: Error


When a user tries to invoice a purchase order that is linked to a Project, the user might receive the following error:

SysDictTable object not initialised.

Stack trace

(S)\Data Dictionary\Tables\SourceDocumentHeader\Methods\getSourceDocumentImplementation – line 5
(S)\Classes\SourceDocumentLineItem\parmSourceDocument – line 8
(S)\Classes\ProjectSourceDocumentLineItemHelper\projTransType – line 21
(S)\Data Dictionary\Tables\ProjectAccountingDistribution\Methods\transactionCurrencySalesAmt – line 31
(S)\Classes\ProjFundingLimitTrackingManager\createProjTransFromProjDist – line 43
(S)\Classes\ProjFundingLimitTrackingManager\updateUsingProjAccountingDistribution – line 45
(S)\Classes\ProjFundingLimitTrackingManager\updateUsingAccDistribution – line 30
(S)\Data Dictionary\Tables\AccountingDistribution\Methods\Update – line 9
(S)\Classes\PurchFormletterParmDataInvoice\updateSourceDocumentLines – line 47
(S)\Classes\PurchFormletterParmDataInvoice\reArrangeUpdateParmLine – line 19
(S)\Classes\PurchFormletterParmData\reArrangeLines – line 152
(S)\Classes\formletterParmData\doReArrange – line 15
(S)\Classes\formletterParmData\reArrange – line 8
(S)\Classes\PurchFormletterParmData\reArrangeServer – line 7
(C)\Classes\PurchFormLetter\reArrange – line 21
(C)\Classes\PurchFormLetter\run – line 11
(C)\Classes\PurchFormLetter\main – line 62

Error Message (03:26:41 pm) Removal of suspension of recId allocation for table VendInvoiceInfoTable has failed.


Download and install hotfix 2909584.


Install and recompile for all class changes to take effect.  Also do a Full CIL compile.  The code is executed within via the CIL.  There is also some upgrade script that need to be executing, so make sure you complete the checklist.



Posted in Microsoft Dynamics AX 2012 | 2 Comments

Windows Server 2008 and Windows Server 2012 Setup for best performance

I know there are a lot of blogs and forums out there explaining what to do to increase performance on any of the Windows Server environments.  However, with so much information, I was amazed to find standard settings with the default installation of Windows, can cause major performance problems.  The list below is just a few of the most commonly found problems we have identified.

We have found that you need to change the default setups of Windows Server 2008 and Windows Server 2012 for best performance for Microsoft SQL Server and Microsoft Dynamics AX 2009 and Microsoft Dynamics AX 2012.

These settings are:

  1. Power Option should be set to High performance
    1. Control panel > All Control Panel Items > Power Options
    2. Select High performance
    3. For more information, please read:
  2. Set Problem Reporting Settings to “Never check for solutions”
    1. Control Panel > System and Security > Action Center > Problem Reporting Settings
    2. Select “Never check for solutions (not recommended)
  3. Disable “Windows Search” Service
    1. Administrative tools > Services
    2. Find the Service: “Windows Search”
    3. Right click and disable the service.
  4. Anti-Virus software
    1. Disable real time scanning on all servers.  Depending on the client, this is not always possible.  You might have to specify specific Folders and extensions to exclude from the checks.  However, the easiest is way to identify if the Anti-Virus software is causing any performance problems, it to disable it and see if it makes any difference in performance.


Posted in Performance | Leave a comment

When Exporting certain reports from Microsoft Dynamics AX 2012 to Excel, the values are not numbers, but act as strings

When exporting certain reports from Microsoft Dynamics AX 2012 to Excel, the values are exported as string instead of numbers.

To replicate the issue:
1. Menu: General ledger > Reports > Reconciliation > Vendor > Vendor
2. Click Ok on the dialog window.
3. Once the report has been deployed, click on the Export > Excel button
4. Specify a filename and click save.
5. Open the Excel report
6. Try some math functions with some of the fields, e.g. “=E1+1”
7. Excel will display: #VALUE!

The report is exporting the field as a string. Within the SSRS Report, you will find the code:
=Microsoft.Dynamics.Framework.Reports.BuiltInMethods.ToDisplayStringAmount(Parameters!AX_RenderingCulture.Value, sum(Fields!LedgerAmountMST.Value), true)

This is causing our values to be returned with a space as a thousand separator, but this is not a normal space (Ascii 32). It is a non-breaking space (Ascii 160).

I assume our localisation settings is causing this. We are using a space for our thousand separator.

1. Firstly you can remove the “Microsoft.Dynamics.Framework.Reports.BuiltInMethods.ToDisplayStringAmount(Parameters!AX_RenderingCulture.Value, ” from the report, leaving you with: sum(Fields!LedgerAmountMST.Value). Remember to redeploy the report.
2. The second option is to do a find and replace within Excel. But the trick is to not replace the normal space (ascii 32), but replace 0160. Use ALT 0160 as the find string.
3. Copy this if you can’t use your Alt and number pad: ” “.

Reports causing this error:
I was able to find only one report with this issue, the Vendor / Ledger Reconciliation report.
Menu: General ledger > Reports > Reconciliation > Vendor > Vendor

Posted in Microsoft Dynamics AX 2012 | Leave a comment

Microsoft Dynamics AX 2012 Error resolution

We will list a number of Errors that you can receive within Microsoft Dynamics AX 2012, and the solutions to get AX to work again:

1. “No connection could be made because the target machine actively refused it”

When printing a report, that is using SSRS to produce the report, you might receive the following error:

“No connection could be made because the target machine actively refused it”

There can be a number of reasons why this is happening:
1. The quickest solution is to do a Full CIL Compile. See if that does not resolve the error. Please note, any service that is dependent on the CIL will no longer work, which includes SSRS, Workflow and AIF.

2. Check that the WCF confirmation is correct and you are able to refresh it. I have found the following sitsuation at one of our clients. They are using 2 IP addresses for each server. The IP address we RDP with works fine, but for some reason another machine on the network grabbed the IP address. When I tried to refresh the WCF configuration, the gave me any error.

3. Check that the Proxy settings within internet explorer is not set, or setup correctly – to bypass local addresses.

I hope this gives you a starting point.

Posted in Microsoft Dynamics AX 2012 | 1 Comment

Microsoft Project Server 2010 and Microsoft Dynamics AX 2012 Integration Issue Resolver

Resolving issues with the integration of Microsoft Project Server 2010 and Microsoft Dynamics AX 2012 can be sometimes very difficult, especially if you do not know where to start looking for the issues. That is why I’ve created this document, to help basically myself the next time I need to fix and Integration.

Before you start debugging the issue, confirm the following:

  1. Do a restart of the AOS server and the Project Server
  2. Run a full Compile on the AOT
  3. Run a full Compile on the CIL
  4. Restart IIS on the project server
  5. Restart Services on project server
    1. “Project integration service”
    2. “Project proxy Service”
  • Check Event Log for any errors
  • Restart Service on Project / AOS Server
    “Microsoft Dynamics AX 2012 Synchronization Service”
    Check Event Log for any errors
  • Within the “Microsoft Dynamics AX Configuration Utility”
    Refresh the WCF
    You might want to check the Configuration by logging into the system for the user that is logged in for the “Microsoft Dynamics AX 2012 Synchronization Service”
  • Make sure the 2 batch jobs are running:
    “Updates for Microsoft Project Server Integration”
    “Process transactions for synchronisation service”
  • Make sure the Batch server is setup and running
  • You Must Manually Run PSCONFIG after Installing SharePoint 2010 Patches
    Open an Administrative command prompt.
    Change directory to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN
    Run PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures
  • Resolving Errors

    Error: ”Microsoft Project Server integration settings” form, Integration status stuck in “in progress”

    Error: “Integration log”, Transactions status stuck in Waiting


    i. Check the Default Business Connector setting for the Business Connector user. You might have to log into the system with the user that is running the Service to make sure the business connector setting is correct
    ii. The Batch Job History for:
    1. Updates for Microsoft Project Server Integration
    2. Process transactions for synchronisation service
    3. History of the Batch Job: “Process transactions for synchronisation service” is “Cancelled”
    a. Remove the Batch Job: “Process transactions for synchronisation service”
    b. Reinstall the Batch job, by running the Class:
    i. SyncTransProcess
    c. To Manually run / debug the class: SyncTransProcess, create a new job, with the following code:
    SyncTransProcess s = new SyncTransProcess();

    4. When running Project Server Provisioning you get error: failed
    a. Error:
    i. Failed to provision site PWA with error: Microsoft.Office.Project.Server.Administration.ProvisionException: Post provision setup failed. —> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> Microsoft.SharePoint.Upgrade.SPUpgradeCompatibilityException: There is a compatibility range mismatch between the Web server and database “ProjectServer_Published”, and connections to the data have been blocked to due to this incompatibility. This can happen when a content database has not been upgraded to be within the compatibility range of the Web server, or if the database has been upgraded to a higher level than the web server. The Web server and the database must be upgraded to the same version and build level to return to compatibility range.
    b. When:
    i. Sharepoint Central Administration > Manage Service Applications > Project Server > Create Project Web App Site
    c. Fix:
    i. Run the PSConfig command from above to upgrade all websites

    5. Error within Browse:
    a. Error Message: “An unexpected error has occurred.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: a0ffa929-3fb6-4cbf-87f1-a34dfa89f112
    Date and Time: 11/8/2013 2:43:56 PM“
    b. When:
    Within the Browser, when accessing the Projects Website.
    c. Resolve:
    i. Download:
    ii. Open ULSViewer
    iii. Filter according to CorrelationId
    iv. View Error message

    6. Integration Log Errors
    a. Error 1:
    An error occurred while synchronizing Project entity type of Name:”EXCHANGE SERVER”


    An error occurred while creating the Project compound entity of EntityId:0cfcb10d-4053-4281-a42f-d0bcde7a13e3, Name:”EXCHANGE SERVER” in project server.
    Error: ProjectServerError(s) LastError=CICOAlreadyCheckedOutToYou Instructions: Pass this into PSClientError constructor to access all error information
    PSCLientError Output:

    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)”
    ii. Resolve:
    1. Check in all Objects on the Project Server.
    2. Within Integration log, Click Action, Resynchronize.

    b. Error 2:
    An error occurred while synchronizing Project entity type of Name:”HR”
    An error occurred while creating the Project compound entity of EntityId:d48e03fe-15f4-48a5-88a9-1859b8ca0e3a, Name:”HR” in project server.
    The underlying connection was closed: An unexpected error occurred on a receive.
    Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
    An existing connection was forcibly closed by the remote host
    at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at Microsoft.Dynamics.SyncServices.Library.PSIProxy.Project.ReadProjectList() at Microsoft.Dynamics.SyncServices.Library.ProjServerQuery.ReadProjectUIDByName(String projName) at Microsoft.Dynamics.SyncServices.Adapter.PSEntityAdapter.CreateProject(IDataContainer ProjectContainer) at Microsoft.Dynamics.SyncServices.Adapter.PSEntityAdapter.CreateCompoundEntity(IDataContainer CompoundContainer)
    at Microsoft.Dynamics.SyncServices.Adapter.PSEntityAdapter.CreateCompoundEntity(IDataContainer CompoundContainer) at Microsoft.Dynamics.SyncServices.EntityManager.SynchronizeEntityTrans(String companyId, Guid syncTransId, SerializableContainer _sEntityTrans)
    ii. Resolve:
    1. Within Integration log, Click Action, Resynchronize.

    Posted in Microsoft Dynamics AX 2012, Project Server 2010 | 1 Comment

    How to: Configure the Debugger to Debug a Report Data Provider Class [AX 2012] 

    We followed the instructions provided by Microsoft but it still didn’t work but once we ran the debugger as administrator then it worked.


    Posted in Uncategorized | Leave a comment