Recently I had an issue with a customer who is using Microsoft Dynamics AX 2012 where users were experiencing the dreaded “too many forms” error. If you have experienced this issue you will know that the only way to stop it is to restart the AX client. Restarting the client, however only gets rid of the error for a short period of time.
Searching the net for information doesn’t give much information on what can cause the error. One post from the awesome art of creation blog has some good information though. Especially for explaining how to monitor the user objects using windows task manager.
The “too many forms” error was unfortunately not caused by a missing super() call in a form, however the customer was happy to monitor the task manager whilst testing. I was pretty surprised at this as the people testing thought that this was incredibly tedious. However, the testers managed to narrow down where the problematic code was, and I was able to track down and sort the issue.
The issue was with third party code, as you would probably expect
The problem was essentially that a function was written that returned an object, but was called with out assigning the value to a variable. The main method of the SalesFormLetter class had been overridden to return the local salesFormLetter variable. The users only had to use this class a handful of times before getting the error and having to restart the client.
If you are getting this error, I would recommend getting your testers to monitor the task manager whilst testing. It may annoy them as it significantly slows down their testing, but will make it easier to narrow down the code that is causing it. When you have the form, class or whatever seems to have the issue, check out any customisations in that area.