#MSDynGP Dexterity Login Dialog showing on Application Startup


David Meego - Click for blog homepageThis is an issue that I found back in April 2019 and reported to Microsoft. I added it to my list of articles to write up where it sat until today. Now that I have seen it happen “in the wild” and not just on my test system, I thought I better spend some time to get it documented.

The error occurs when launching Microsoft Dynamics GP and can happen on any version since about v8.0. When you launch GP it displays the Dexterity Login Dialog and if you don’t log in, it will generate a couple of error dialogs.

The Problem

This is what the errors look like:


Dexterity Login Dialog


An open operation on table ‘SY_Pathnames’ failed because you are not logged in to a valid data source.


Unhandled script exception: Illegal address for field ‘Company ID’ in script ‘SQL_GetDbName’. Script terminated.

The Cause

The issue is that the Dexterity SQL Login dialog pops up before the Dynamics GP login. This happens when a product attempts to access SQL before the user has logged in.

The usual cause for this is a developer forgetting to use the anonymous() function when registering table triggers in a 3rd party product. But it can also be caused by code in a script trying to access anything on the SQL Server when system has not yet logged in.

The additional error dialogs helped find the cause for this specific instance. Using the Resource Information window in GP Power Tools in Procedure and Function mode, I was identify that the product dictionary that the function SQL_GetDbName() comes from. Then using GP Power Tools again to Capture Logs on Startup I was able to capture the sequence of calls.

The culprit is SmartList when it causes a call to SQL_GetDbName() from its Startup script which attempts to access the SY_Pathnames table.

<Technical Stuff>

Here is an excerpt from the log:

20:33:06  ‘Startup’
20:33:06      ‘ASI_ExplorerFormatCurrency()’, 0
20:33:06      ‘ASI_Check_SQL_Sort_Order’
20:33:06          ‘GetSystemDatabaseName()’, “”, 0
20:33:06              ‘SQL_GetDbName()’, “”, 0, 0, 7, 0, 0

Further testing identified that this problem only shows up if Advanced Security is above SmartList in the Dynamics.set launch file so that it runs its Startup script first.

Below is the log when Advanced Security is after in the launch file and you can see that the call to GetSystemDatabaseName() does not happen.

21:26:21  ‘Startup’
21:26:21      ‘ASI_ExplorerFormatCurrency()’, 0
21:26:21      ‘ASI_Check_SQL_Sort_Order’

Looking at the Startup script for Advanced Security I found the code below which sets the ‘SQL Server’ of globals variable.

{ Set ‘SQL Server’ of globals variable }
l_product = productInUse() of form LibRegistration;
if ‘SQL Server’ of globals = 0 then
call Initialize;
end if;

Looking at ASI_Check_SQL_Sort_Order in Smartlist, it only attempts to access the SQL Server if ‘SQL Server’ of globals has been set.

if ‘SQL Server’ of globals > 0 then
{Query SQL for Sort Order}
l_SQL_Return_Status = SQL_Connect(lSQLConnection);
c_sqlcmd = “select DATABASEPROPERTYEX(‘” + GetSystemDatabaseName() + “‘, ‘SQLSortOrder’)”;

The fix to this issue (which I provided to Microsoft) is to remove the call ASI_Check_SQL_Sort_Order from the Startup script in the Smartlist Dictionary.

This code should not be called from the Startup script. If ‘SQL Server’ of globals has been set it causes the bug and if ‘SQL Server’ of globals has not been set, the code does nothing anyway. It needs to be called after login instead.

</Technical Stuff>

The Solution

Until Microsoft actually fix the bug in Smartlist, then the only solution is to ensure that Smartlist is listed before Advanced Security in the Dynamics.set launch file.

If the error still occurs, it is possible there is another product setting the ‘SQL Server’ of globals variable. The guaranteed fix is to move the Smartlist product to the second position in the Dynamics.set launch file after product 0 for Microsoft Dynamics GP.

Footnote

I found this problem when developing the Launch File Configuration feature in GP Power Tools which uses rules to make changes to the Dynamics.set launch file automatically so the administrator does not need to visit every workstation to apply changes. One of the rules can reorder the products by alphabetical order which puts Advanced Security (A) above Smartlist (S).

So, to avoid this error occurring the Launch File Configuration window will automatically add an extra rule to place Smartlist above Advanced Security if it detects this issue will occur.

Thanks to Beat Bucher for finding the error on a live system and prompting me to finally write this up.

Hope you find this information useful.

David

This article was originally posted on http://www.winthropdc.com/blog.

2 thoughts on “#MSDynGP Dexterity Login Dialog showing on Application Startup

  1. Reblogged this on The Dynamics GP Geek Blog and commented:
    Today I was upgrading a client’s UAT system from GP 2018R2 to the October release 2019 of GP and added manually a custom dictionary the client had since GP 10.. While there was no specific install routine for this custom code, I simply added it to the DYNAMICS.SET launch file in 2nd position.. Soon as I tried to run GP, I got prompted for a SQL login with the ‘sa’ user… read on David’s post why this happens and how to easily fix it.

    Like

Please post feedback or comments

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.