The problem I was seeing was just by having GP Power Tools installed, the web client would crash after login or when opening the first window. Note that this issue is resolved now.
I spent some time analysing the GP Power Tools code and tracking the flow of the scripts by adding warning statements into the code until I was able to narrow down the feature that was causing the crash.
Further investigation allowed me to identify the actual script causing the problem and finally, I was able to locate the actual line of code. The reason it was harder than normal to locate the issue was that the code in question was dynamically created pass-through Dexterity sanScript code executed in the context of the runtime engine’s Dex.dic dictionary.
To access more detailed dictionary resource information than available via the Resource_ function library commands, GP Power Tools and in particular the Resource Explorer window use the Script Explorer window in the Dexterity runtime engine. Dexterity developers will be familiar with the window which has part of the script debugger and is used when opening or debugging scripts.
The techniques using this window were published in my 2001 conference session Pushing the Limits with Dexterity. For more information see the Cross Dictionary Dexterity Development article on my old blog.
The error was caused by the line of code that opened the Script Explorer form in a script that would retrieve a list of windows for a specified form in a dictionary.
I knew that the Field Level Security feature included with Dynamics GP (which I originally developed as Omni Field Security) has a similar Resource Explorer window. So I tested that window and it seemed to work fine.
Then I noticed that my script closed the Script Explorer form before opening it and wondered if the issue was not opening the Script Explorer, but re-opening it after it had been closed.
The Resource Explorer window in GP Power Tools and the one in Field Level Security also closed the Script Explorer window when the Resource Explorer form is closed.
So I tested the theory and closed Field Level Security (and so the Resource Explorer and in turn the Script Explorer) and then re-opened Field Level Security (which opens the Resource Explorer and the Script Explorer) and boom. It crashed with the following error:
A server side exception of type “ArgumentException” has occurred.
I have since updated GP Power Tools to never close the Script Explorer window and just to initialise it when it is needed. This has resolved the crashing problem.
However, if you open and close Field Level Security and then re-open it, you can cause the web client to crash. It might not happen every time, but be aware that using Field Level Security more than once per web client session could be risky.
Note: While trying to reproduce the error to get the screenshots for this article, it took a few goes before the web client crashed.
If you are game, try it and let me know (via the comments) if you can replicate. Maybe it is just my install. If the session does crash, make sure you clean up the stranded session using End Task with Task Manager.
Also don’t forget to log back in as the same user and company to clean up the activity tracking records.
PS: I have also reported this issue to Microsoft and they will investigate it.
This article was originally posted on http://www.winthropdc.com/blog.