Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

GP 2016 VStools addin integration with web client - Dynamics.Globals.SqlPassword getting wrong password

Posted on by Microsoft Employee

I am working on a customization for a client in GP 2016 -  They are using the desktop client as well as the web client.  

in my C# code I am using Dynamics.Globals.SqlPassword and Dynamics.Globals.UserId to make a connection to the database.  

It works fine on the desktop client and I'm able to connect to the database - but when using the web client it seems to be grabbing a different password and therefore failing to connect.  

I assumed it was getting the password of the user setup to connect the web client to the database (gpwebclient) but I tried hardcoding that username and it's still failing.  

Any ideas here?  Having trouble finding supporting documentation for this area. 

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: GP 2016 VStools addin integration with web client - Dynamics.Globals.SqlPassword getting wrong password

    so looks like I was backwards.. it was getting the right password, wrong user... for the webclient I had to use the sqlLoginID instead of the UserId

    // if it's the desktop client we will use the gpusername/password to authenicate ...

                   if (Dynamics.Forms.SyVisualStudioHelper.Functions.DexRuntimeGetClientType.Invoke() == 1)

                   {

                       Username =  Dynamics.Globals.UserId.Value;

                   }// if it's the web client we'll use the sqllogin/password

                   else if (Dynamics.Forms.SyVisualStudioHelper.Functions.DexRuntimeGetClientType.Invoke() == 2)

                   {

                       Username = Dynamics.Globals.SqlLoginId.Value;

                   }

    all is good in the world now

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,188 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans