Open Forum

Expand all | Collapse all

Login Form DataSource Name

  • 1.  Login Form DataSource Name

    TOP CONTRIBUTOR
    Posted Mar 13, 2018 12:02 PM
    I'm trying to figure out how to get the name of the DataSource (Server) that is selected on the the Login form. I'm trying to do this before the user has logged into the system so Globals.SqlDataSourceName is not set yet. I can get the value as a SingleSelectList index, but can't figure out how to turn that into the string representation of the DataSource name.

    ------------------------------
    Matthew Arp
    Business Systems Developer
    Hunton Group
    Houston TX
    ------------------------------
    Conference-GPUG_200x200


  • 2.  RE: Login Form DataSource Name

    Posted Mar 13, 2018 12:11 PM
    This is in the Registry:
    hkey_local_machine > software > wow6432node > odbc > odbc.ini

    All the connections are listed by name. There is a value stored for the SQL instance under the name "Server"


    ------------------------------
    Joshua Pelkola
    Managing Consultant
    BKD Technologies
    San Antonio TX
    ------------------------------

    Conference-GPUG_200x200


  • 3.  RE: Login Form DataSource Name

    GPUG ALL STAR
    Posted Mar 14, 2018 02:41 AM
    Hi @Matthew Arp

    What's the big picture? What language are you using?

    There is a call made by GP to populate the Datasource Drop Down List.

    I could look in the source code to see how that is done.

    David​​

    ------------------------------
    David Musgrave MVP, GPUG All-Star

    Managing Director
    Winthrop Development Consultants

    Perth, Western Australia

    http://www.winthropdc.com
    ------------------------------

    Conference-GPUG_200x200


  • 4.  RE: Login Form DataSource Name

    TOP CONTRIBUTOR
    Posted Mar 14, 2018 08:48 AM
    @David Musgrave the end goal is I am using the the AlterLogin​​ function on the EnterUserNames form to sync passwords between various GP environments. This function appears to require the DataSource name as the first parameter. I am using .NET with some injected SANScript. After @Joshua Pelkola recommended referencing the ODBC config, I just used a .NET wrapper to odbc32.dll​ to iterate over the data sources. This does appear to work, but I'm still curious if there was a easier way to translate the selected DataSource index to the text that's actually displayed in the UI.

    ------------------------------
    Matthew Arp
    Business Systems Developer
    Hunton Group
    Houston TX
    ------------------------------

    Conference-GPUG_200x200


  • 5.  RE: Login Form DataSource Name

    GPUG ALL STAR
    Posted Mar 15, 2018 02:37 AM
    If you want to get the text of a List field in Dynamics use can use the Dexterity sanScript command itemname(<Field>, <Position>).

    Is that what you were looking for?

    David

    ------------------------------
    David Musgrave MVP, GPUG All-Star

    Managing Director
    Winthrop Development Consultants

    Perth, Western Australia

    http://www.winthropdc.com
    ------------------------------

    Conference-GPUG_200x200


If you've found this thread useful, dive deeper into User Group community content by role