Quick Tip: Solving Illegal Address Errors on Alternate Windows after installing a Service Pack

David Meego - Click for blog homepageEvery time a Service Pack for Microsoft Dynamics GP is released, there is a potential for the installation of the service pack to cause Illegal Address errors for a field on Modified or Alternate windows.  I have seen this a few times over the years, mostly with the Sales Transaction Entry (SOP_Entry) window in the Sales Order Processing (SOP) module.

The reason for this error is usually that the Service Pack adds a new field onto the window and also updates the scripts to use this new field.  If the Modified or Alternate version of the window has not been updated to include this new field, when the code executes and references the missing field, the error is generated.

Illegal Address for field field name in script script name

How can I fix an Illegal Address Error on an Alternate or Modified window after installing a Service Pack?

Firstly, you should confirm exactly which version of the window is "at fault".  Use the security settings (or the Alternate Modified Forms and Reports ID for GP 2010) to tell the system to use the Original version of the window.  When using the Original, there should be no error.

Note: If you get an error referring to a missing resources added by the Alternate window, it means that the addon product is not checking to see if its Alternate window is in use before running its trigger code.  The best practice for handling this is explained in the following Knowledge Base (KB) articles:

If the problem occurs only on the Modified or Modified Alternate version of the window, but works on the Original or Alternate version of the window, then you will need to just recreate the Modified window.  The following steps should resolve the issue:

  1. Using Customization Maintenance (Tools >> Customize >> Customization Maintenance) export the window as a package file.
     
  2. If there is Visual Basic for Applications (VBA) code associated with the window, open the window and select Tools >> Customize >> Remove Current Window from Visual Basic.
     
  3. Then go into the Modifier (Tools >> Customize >> Modifier), select the appropriate product, locate the form containing the window and Delete it.
     
  4. Return to Microsoft Dynamics GP (File >> Microsoft Dynamics GP) and use Customization Maintenance to import the package saved in step 1.
     
  5. Test.
     
  6. Backup.

This process will recreate the window from the Original (or Alternate) version and will not include the previously missing field.


If the problem occurs with an Alternate version of the window, then the solution has to be handled at the Dexterity level.  The cause is the same (missing newly added field), but the resolution is slightly different. To fix the issue:

  1. Load Dexterity with your development dictionary.
     
  2. Make sure all your code is checked into your source code repository (usually Microsoft Visual Source Safe).
     
  3. Make sure your Index File is up to date. Update it again if you have added any new resources since last build.
     
  4. Make sure that the Original Dictionary (Edit >> Options >> Source Control) is pointing to a clean dictionary of the latest Service Pack build.  This is usually the dictionary in the application folder after installing the Service Pack.
     
  5. Exit Dexterity and rename or move your development dictionary.
     
  6. Copy the clean dictionary (as referenced in step 4) to your development folder and rename it to your development dictionary name.
     
  7. Launch Dexterity again and Update using index file (Explorer >> Source Control >> Update) to bring in your customization.
     
  8. Recompile the entire dictionary and exit Dexterity.
     
  9. Use the Dexterity Utilities to recreate your chunk (usually using already recorded macro).
     
  10. Test.
     
  11. Backup.

Note: If there is a Modified version of the Alternate window, you will also need to perform the first set of steps to update that version.

That's all folks. Hope this is helpful. 

David