Developing for Dynamics GP

by David Musgrave (Perth, WA, Australia) and the Microsoft Dynamics GP Developer Support Team (Fargo, ND, USA)

Dex - Illegal address for field 'PowerUser' exception

Dex - Illegal address for field 'PowerUser' exception

  • Comments 5

David MeegoToday 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:

  1. Open Dexterity and open your development dictionary.
     
  2. From the menus, click Edit, click Options and click on the Source Control tab.
     
  3. 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
     
  4. Click OK to save the changes.
     
  5. Exit Dexterity.
     
  6. Using File Explorer, rename or move your current development dictionary to create a backup. This backup can be deleted later if desired.
     
  7. 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.
     
  8. Re-open Dexterity and open your development dictionary.  This will now be a base Dynamics.dic dictionary.
     
  9. From the menus, click Explorer, click Source Control, and click Update SCC State.
     
  10. Then click Explorer, click Source Control, and click Update....
     
  11. In the Options section, select the Use Index File checkbox and click OK.
     
  12. Leave all the resources selected, and then click OK to start the update.
     
  13. 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:

How to set up the development environment when you use Dexterity in Microsoft Dynamics GP (KB 949622) Secure Link

How to upgrade a Dexterity-based application in Microsoft Dynamics GP or in Microsoft Great Plains by using the Dexterity Source Code Control Service (KB 910527) Secure Link

How to use an index file and the Microsoft Dynamics GP Dexterity source code control functionality to make sure that the resources that you create maintain the same resource ID in different builds and versions of your code (KB 894699) Secure Link

 

This issue is now covered in the following KB article: 

Error message when you try to enter Debugging Test mode after you upgrade a custom Dexterity application to Microsoft Dynamics GP 10.0: "Illegal address for field 'PowerUser' in script 'Setup_System_Variables'. Script Terminated" (KB 961968) Secure Link

 

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.

  • Posting from the Dynamics GP Blogster

    http://dynamicsgpblogster.blogspot.com/2008/10/developing-for-dynamics-gp-weekly.html

  • Sorry, but i don't use Source Code Control, what can i do?

  • 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.

    David

  • 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

    Ivy

  • 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

Page 1 of 1 (5 items)
Comments Information

PLEASE READ BEFORE POSTING

Please only post comments relating to the topic of this page.

If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.

Leave a Comment
  • Please add 2 and 2 and type the answer here:
  • Post