Skip to main content

Notifications

Microsoft Dynamics SL forum
Unanswered

Dynamics SL7 Object Model Login

Posted on by 305

Hi, I designed a screen that imports data from Excel to create shippers by COM. The file that contains the information also includes a column with the Company. I am using the following structure to Login into SL:

sivtbCurrent.Login(bpes.DBServerSystem, bpes.DBNameSystem, bpes.CpnyID, bpes.UserId, "Password")

It works fine if I leave the password in the code (for example for SYSADMIN); but this is not practical, because the password has to be dynamic; the program has to pass the correct password of the user who is running the process. How can I send this parameter dynamically?. I tried sending the value PNULL, NOTHING, blanks, ect, and it doesn't work. In the UserRec table the passwords are encrypted, and I can't use them.

Thanks.

  • Alberto Viveros Profile Picture
    Alberto Viveros 305 on at
    RE: Dynamics SL7 Object Model Login

    Hi Ajitkannan; at the end I solved this problem changing the authentication of Dynamics as Windows Authentication. On this way, I use the following functions without problems:

    sivtbCurrent.Login(bpes.DBServerSystem, bpes.DBNameSystem, bpes.CpnyID, bpes.UserId, "")

    FormComm = sivtbCurrent.StartApplication("4011000.exe", "0060")

    I left the password in blank, and due to the authentication, SL doesn't validate the password, and I can use them dinamically, what is the way I need to have.

    Thank you very much for your help.

    Regards,

  • Ajit Kannan Profile Picture
    Ajit Kannan 1,240 on at
    RE: Dynamics SL7 Object Model Login

    Hi Alberto Viveros,

    The folder as Import-export must be creating in SL root folder and Place the .ini file under import-export folder. Also mention the Directory Path in process screen.

    proceed with the below mentioned steps.      

    1. Sol Login  - Mention the Directory Path

                      Ex:  My.Application.Info.DirectoryPath & "\" & EXPIMPPATH (.INI file)

            2.  AppStart – Mention the Directory Path

                      Ex: SIVTb.StartApplication (My.Application.Info.DirectoryPath & "\OM\" & SIVExe (4011000.exe))

           3.   AppCtrlInstantiate – Define the Shipper Header & Detail control

           4.  Insert the Shipper Data

    Thanks,

    Ajitkannan

  • Alberto Viveros Profile Picture
    Alberto Viveros 305 on at
    RE: Dynamics SL7 Object Model Login

    I forgot to mention that the user is already logged in to Dynamics; and he is going to work in a new screen which executes the Shipment screen in SL. So it is not necessary that the user log in to Dynamics. If I am registering data in the same company where I am logged in, the function:

      FormComm = StartAppAndAutomate("4011000.exe", iSolErr, iOSErr)

    works corrrectly. But if the user needs to register data for other company, the previous function doesn't work; I can't pass the parameter of company. Instead of that,  I use this function:

     FormComm = sivtbCurrent.StartApplication("4011000.exe", "0060")

    In the second parameter I send the company. The problem is that if I want to use the "StartApplication" function I need to use before the login event:

      sivtbCurrent.Login(bpes.DBServerSystem, bpes.DBNameSystem, bpes.CpnyID, bpes.UserId, "Password")

    If I forget to put this function previously, an error message appears saying "Not logged in".

    And here is where I have the problem; how can I pass the password if I don't know it?.

    Regards.

  • Alberto Viveros Profile Picture
    Alberto Viveros 305 on at
    RE: Dynamics SL7 Object Model Login

    Thanks Ajit, I made the test creating the file exactly in the same way than your example; I copied it under SL folder, but it is not updated when I change the password in SL; what I am doing bad?; in theory this file should be updated automatically by Dynamics for each user only if I place it under SL folder?.

  • Ajit Kannan Profile Picture
    Ajit Kannan 1,240 on at
    RE: Dynamics SL7 Object Model Login

    Hi Alberto Viveros,

    We could handle this through .INI file. 

    In that INI file, We could define the necessary information like Drive path, Folder & Password etc. (Refer the below screen shot)

    Get the Password value from INI file and pass that value through sivtbCurrent.Login parameters.

    Also you need to place this INI file under SL root folder. 

    Thanks,

    Ajit Kannan

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans