VBA - Adding Fields to VBA stops working


David MeegoWhile working with Microsoft Dynamics GP v9.00, I have seen a situation where adding fields to VBA does not work anymore.  You can add windows and reports, but when adding a field they don't show up on the project.

If you try to import a package file with with a customsation using Customisation Maintenance you will receive a "Component Write Exception" error and the VBA part of the code will have not imported correctly.

I am not sure exactly what is going wrong and it is difficult to reproduce this issue on demand.  This probably explains why it has not been fixed yet.  It does not seem to happen with v8.00 or v10.00.

The only solution I know to resolve this is to export all the customisations as packages using Tools >> Customise >> Customisation Maintenance.  Then you can rename all the custom forms and reports dictionaries and the *.vba files to remove all the customisations. Then you can import the customisations back using the previously exported packages.

Hints:

  • Import reference packages before importing other packages to avoid referencing errors.
  • If you made format, string or message changes they will need to be remade as they are not included with packages.  Record a macro of these changes if you want to be able to remake them on demand. For more information see Formats Not Exported to .Package Files (KB 851092) Secure Link.

Post a comment if this has happened to you, especially if you know how to consistently reproduce the issue.

David

Comments (2)

  1. jarnh@comcast.net says:

    I modified the bank deposit entry window and couldn't add fields in VBA, even though it let me ad the window. The odd think is, it added the window under the wrong object in VBA, in my case project accounting (as in Microsoft_Dynamics_GP > Project_Accounting_Object).  PA doesn't have an alternate bank deposit window.

    I tried your suggestions, i.e., renaming Dynamics.vba and Forms.dic, with no luck.  I tried changing the status of PA to disabled, still no change.  Then I went into the set file and took out PA, and tried again.  This time, it put the window into VBA under a different object: Microsoft_Dynamics_GP > Fixed_Assets Object.  I then stripped the set file of everything except the dynamics dictionaries, deleted Dynamics.vba and Forms.dic, and modified the window manually again.  When I added it to VBA this time, it was under Microsoft Dynamics GP Objects as it should be, and the fields I'd added were there.  I saved everything and logged out and put the original set file back, and when I went back in the fields were still there and the form was listed under the correct object.

    Dynamics version 9.00.0281, Dex version 9.00.0073.0

    Jarn Heil

Skip to main content