Category Archives: Microsoft Dynamics AX

Insufficient memory to run script

Today I met a boundary when creeating a routine that produces a pricelist in AX 4.0 for a webshop. When creating the required xml I was receiving the error:

Error executing code: Insufficient memory to run script.

It turns out that AX4.0 per default has a 4mb buffersize. And as the resulting xml would contain about 16 mb of data I kept getting the exception. I found good help to increase the buffersize in this post from Martin Dráb.

How to export configuration settings for AIF inbound/outbound ports

A very tedious task of mine has often been to deploy AIF services accross environments. I am used to do this the old school way = manually.

Today I had something that might be compared to as an epiphany – I stumbled upon this great technet artichle descripting how to export the configuration settings using the data import/export framework. Tried it out for the first time today and it’s working just great. The only downside so far, is that I haven’t been aware of this feature before…:-)

Unable to render content due to an error. Please contact your system administrator.

Recently I experienced a strange error in an usercontrol. The error would cause the classic “Unable to render content due to an error. Please contact your system administrator.” message on EP and in the eventviewer I saw this:

EV1

EV2

EV3

The strange thjing turned out to be that the code for the usercontrol was an exact match with the one from a reference environment where everything worked just fine.

Trying to narrow things down I ended up finding that it was the AllowPaging property on the grid that was set to false that caused the error. Setting this property to true, would make the control work just fine. However my customer didn’t want paging – and it woked just fine in the reference environment. Giving this thought I concluded that the error was related to data. In my environment the dataset would return 55 records and in the reference environment I would have just 12 records. I started to play around with the PageSize property of the grid and found the the magic limit was 45 records. A limit of 44 in the PageSize property would make the control work just fine, whereas a limit of 45 would make the control crash with the above eventlog entries to follow.

I don’t think that the error is related to 45 records but more likely the size of the entire dataset. In my case the dataset contains information about expences and in that context some image/binary bitmap data. I therefore expect the data to be quite big.

 

Conclusion:

If you begin to experience strange errors like the ones above – maybe it would be a good idea to look into the size of data.

Assembly containing type xxx.xxx is not referenced

When developing VS studio components in AX2012 You might experience the following error trying to run the code:

dll_could_not_be_referenced

When You build your vs project You will have to decide whether to publish to either client or server or maybe even both. This is where You need to keep in mind, that the server is quite certain to run as a 64 bit application where the client runs in 32 bit mode. So when building your dll for either server or client, You need specifically target the right cpu architecture. If You are deploying to both client and server You need to build using the “AnyCPU” option.

Using the AnyCPU option will cause a warning when compilling – just ignore it…

If You need to test your component on both server and client an easy way could be to:

  1. create a class with a new method and instantiate your dll in that method.
  2. Set the class to run on client
  3. Create a job and run the method.
  4. Switch the class properties to run on server and perform the same test again.
  5. If no errors occur You are good to go…

The HTTP request is unauthorized with client authentication scheme ‘Basic’. The authentication header received from the server was ‘Basic realm="some_name"’.

Today I spent quite some time struggling how to figure out was wrong with my client implementation of an AIF webservice. I kept getting the error “The HTTP request is unauthorized with client authentication scheme ‘Basic’. The authentication header received from the server was ‘Basic realm="some_domain_name"’.”

It was the realm part I didn’t understand. I had configured the service in AX to use basic authentication. From a reference environment, I knew the configuration had been working.

It turned out that my focus on the realm part was wrong because the reason to the error was invalid login credentials. How invalid login credentials can trigger the above error message is not for me to say. I would have expected a message like “Failed to log in to Microsoft Dynamics AX” instead. Just thought I would share my experience…

Troubleshooting Enterprise Portal error messages

If you have been working with enterprise portal development, you will probably have gone through the same levels of frustration as I because error messages are not good in adding usable information into these messages. Over time I have collected some sites with suggestions on how to troubleshoot these more or less cryptric messages.

Error: Enterprise Portal Web Parts show "Unable to render content" error
https://blogs.msdn.microsoft.com/emeadaxsupport/2010/09/23/enterprise-portal-web-parts-show-unable-to-render-content-error/

Error: Unable to render content due to an error. Please contact your system administrator.
https://blogs.msdn.microsoft.com/emeadaxsupport/2010/11/17/how-to-troubleshoot-enterprise-portal-error-unable-to-render-content-due-to-an-error-please-contact-your-system-administrator/

Generel troubleshooting: https://msdn.microsoft.com/en-us/library/cc554278.aspx