Dex - Illegal address for field 'PowerUser' exception
Today I saw another posting on the Microsoft Dynamics GP Community Forum about an error when going into Dexterity test mode after upgrading an application from a previous version to version 10.0.
The error message is as follows:
Unhandled script exception:
Illegal address for field 'PowerUser' in script 'Setup_System_Variables'. Script terminated.
Note 1: When upgrading to GP 2010, the same issue can cause the following error message:
Unhandled script exception:
Illegal address for field 'ReportTemplatesEnabled' in script 'Setup_System_Variables'. Script terminated.
Note 2: When upgrading to GP 2013, the same issue can cause the following error message:
Unhandled script exception:
Illegal address for field 'System Database Name' in script 'GetSystemDatabaseName'. Script terminated.
I have seen this error reported a few times and so I will post the solution here.
I am assuming that you are using source code control and that before upgrading all resources have been checked in and the index file updated. For more information on the index file look at the Getting Started section of the Dexterity Articles & Links page.
I am assuming you then upgraded into a copy of a new, clean v10.0 Dynamics.dic file using Explorer >> Source Control >> Update... from the Resource Explorer menus. Then you checked the "Use Index File" option.
NOTE: Do not use the toolbar Update button as this will not use the index file and cause all your resource IDs to be renumbered in alphabetical order.
Now when selecting Debug >> Test Mode or Ctrl-T, you receive the error message.
Cause
This issue is occurring as the new 'PowerUser' of globals system variable does not exist in your development dictionary. There may be other missing resources, but this is the one that causes an error before anything else.
The reason that the 'PowerUser' of globals system variable is missing is because during the process of updating your custom code to version 10.0, Dexterity was not set up correctly to have the Original Dictionary Source Control setting point to a unaltered version 10.0 Dynamics.dic dictionary. This means that when Dexterity compares the contents of the repository to the Original Dictionary, it does not realise that the 'PowerUser' of globals system variable was added in version 10.0 and allows it to be overwritten when the Fields and Globals base resources are brought in from the repository.
Resolution
Note: The steps below assume that you are using Source Code Control, already have all the resources from the previous version checked into a source code respository and that you have created an index file for the resources in the previous version.
To fix please follow the steps below:
Open Dexterity and open your development dictionary.
From the menus, click Edit, click Options and click on the Source Control tab.
Enter the path for Original Dictionary to point to the Dynamics.dic dictionary from your version 10.0 application installation:
Default location: C:\Program Files\Microsoft Dynamics\GP\Dynamics.dic
Click OK to save the changes.
Exit Dexterity.
Using File Explorer, rename or move your current development dictionary to create a backup. This backup can be deleted later if desired.
Copy the Dynamics.dic from the application folder (as per step 3) to the folder where your development dictionary resides and rename it to the name of your development dictionary.
Re-open Dexterity and open your development dictionary. This will now be a base Dynamics.dic dictionary.
From the menus, click Explorer, click Source Control, and click Update SCC State.
Then click Explorer, click Source Control, and click Update... .
In the Options section, select the Use Index File checkbox and click OK.
Leave all the resources selected, and then click OK to start the update.
The resources will then be imported from the repository and the scripts compiled.
Now because the Original Dictionary setting was a base version 10.0 Dynamics.dic, the missing resources will be available and the error will be resolved.
The following Knowledge Base (KB) articles explain the process of upgrading Dexterity applications and how to use an index file:
This issue is now covered in the following KB article:
Please post a comment if this solution helps you.
David
17-Apr-2009: Added Link to KB 961968.
19-Aug-2010: Added extra error message for upgrading to GP 2010.
19-Feb-2013: Added extra error message for upgrading to GP 2013.
20-Feb-2013: Added post: Dex - Illegal address for field 'System Database Name' exception.
Comments
Anonymous
October 16, 2008
Posting from the Dynamics GP Blogster http://dynamicsgpblogster.blogspot.com/2008/10/developing-for-dynamics-gp-weekly.htmlAnonymous
December 10, 2010
Sorry, but i don't use Source Code Control, what can i do?Anonymous
December 11, 2010
Hi Santiago You will need to use source code control to upgrade applications from v6.0 onwards. Even if this is just the Generic Source Code control provider which uses text files in folders rather than Visual Source Safe. DavidAnonymous
May 08, 2013
Hi David, I am upgrading from GP10 to GP2013. I followed your article to resolve "Unhandled script exception: Illegal address for field 'System Database Name' in script 'GetSystemDatabaseName'. Script terminated." issue. However now I get "Unhandled script exception: Illegal address for field 'System Database Name' in script 'GetSystemDatabaseName'. Script terminated." error message in debug mode. Does it mean I will need to upgrade from 10 to 2010 then 2013? Thanks IvyAnonymous
May 08, 2013
Hi Ivy You don't need to upgrade versions again, you just need to redo the update from the repository... after changing the original dictionary in the source control settings. David