VBA: DUOS data stored in the wrong database after switching companies

David Meego - Click for blog homepageA while ago I had a case where the customer was storing data in the DUOS (Dynamic User Object Store) table from a VBA (Visual Basic for Applications) customisation. Everything worked fine until the users switched companies. After switching company the VBA customisation would still be connected to the DUOS table in the previous company's database. If the user exited Microsoft Dynamics GP and logged back in, the DUOS in the correct database was used.

The DUOS table is in fact the SY_User_Object_Store (SY90000) table in the company database and is usually used by VBA to store additional data without needing to create new tables in the SQL Server databases.

When you switch companies, the connection to the DUOS table is closed so it can be re-opened once you have logged into the new company. If for some reason the DUOS table is not closed, the DUOS table will still point to the previous company database rather than the new company database.

We were able to identify the cause of the issue as the Support Debugging Tool (builds 17 or earlier). The SDT can use the SY_User_Object_Store to store temporary data when using helper functions to create parameters to pass data between scripts. When exiting Microsoft Dynamics GP or switching companies, it executed some code to remove any temporary records left in the table. It turns out that this code ran after the core code had closed the table and so re-opened the table causing the issue.

Build 18 (released in February 2014) or later of the Support Debugging Tool resolves this issue. 

Recently, I had another case with the same issue and the same cause.  So I decided to write a specific blog post to request the Dynamics GP community make sure they are running the latest Support Debugging Tool builds.

So, if you use VBA with the DUOS and have the Support Debugging Tool installed, please ensure you download the latest version and install it on your server and all workstations. Please go to the Support Debugging Tool Portal (https://aka.ms/SDT) for links.

Note: Assuming you are using the "Recommended Configuration" with a shared Debugger setup file location, once you have installed a later build on one workstation and logged in, all other workstations will pop up a warning dialog on login until they are also updated.

Thanks for your support. 

David