cancel
Showing results for 
Search instead for 
Did you mean: 

Can not connect to second company after 9.0 upgrade

pieter_verhaeghe
Explorer
0 Kudos

See my source code below:

//Connect to UI API

SboGuiApi SboGuiApi = new SboGuiApi();

string connString = Environment.GetCommandLineArgs().GetValue(1).ToString();

SboGuiApi.Connect(connString);

application = SboGuiApi.GetApplication();

// Connect to DI API (first company)

company1 = (SAPbobsCOM.Company)application.Company.GetDICompany();

// Connect to DI API (second company)

company2 = new SAPbobsCOM.Company();

string cookie = company2.GetContextCookie();

string connContext = application.Company.GetConnectionContext(cookie);

if(company2.SetSboLoginContext(connContext) == 0){

                company2.CompanyDB = "dbname2";

                company2.Connect();

                if(!company2.Connected){

                    SAP.application.StatusBar.SetText(company2.GetLastErrorDescription(), BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);

                    // STOP

                }

}

System.Windows.Forms.Application.Run();

My add-on makes a DIAPI connection with 2 companies. This code worked well with SAPB1 8.82. When I did the upgrade to 9.0 PL04 previous week, my add-on no longer connects to the second company and gives this error: "Unable to connect with the specified username and or password".

What must be changed in my source code to make the connection of the second company to work again?

Thanks for you help!

Regards,

Pieter

Accepted Solutions (1)

Accepted Solutions (1)

edy_simon
Active Contributor
0 Kudos

Hi Pieter,

In new SBO 9 there is a new restriction in place for user login.

Basically, the same user may only login to the same company once.

But based on our testing, it is still very buggy.

I notice that you are connecting to different company.  Yet you are getting the restriction.

Maybe you can open a ticket for support.

Based on my testing, if you connect the 2nd company by providing user name and password instead of using cookie, you should not get this problem.

Regards,

Edy

pieter_verhaeghe
Explorer
0 Kudos

Thanks for your answer. If you find a SAP note related to this problem, please post it in this topic so I can follow up on this.

Thanks,

Pieter

Answers (4)

Answers (4)

pieter_verhaeghe
Explorer
0 Kudos

Is it possible that SAP 1837139 is related to my problem?

1837139  - Error Message Appears When Using Multiple DI API Connection Method to Connect Add-Ons to SAP Business One


https://websmp130.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F...

edy_simon
Active Contributor
0 Kudos

Hi Pieter,

No, the Notes is reffering to the 'Multiple DI API connection' method (in B1DE),

Not multiple connection to DI API as was in your case.

And according to the note, the problem has been solved in SBO9 PL4.

Definitely not your case...

Regards
Edy

edy_simon
Active Contributor
0 Kudos

Hi Pieter,

For more info on this new restriction, you can look for SAP Note 1815509

Regards

Edy

former_member609283
Participant
0 Kudos

Hi,

This is because you have same Username of both companies. There are some limitations of 9.0..Please read it about the user login.

Regards,

Idrees

pieter_verhaeghe
Explorer
0 Kudos

I thought the same user can connect to as many companies as (s)he wants as long as the session is the same. Session in 9.0 is defined as client IP, windows user, windows session.

See SAP note 1815509: https://websmp130.sap-ag.de/sap%28bD1ubCZjPTAwMQ==%29/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F...

Former Member
0 Kudos

Hi,

     Thus your Company 1 and 2 are have the same username and password? Or have you tried to hard code the username, password in your company 2?

Regards,

pieter_verhaeghe
Explorer
0 Kudos

Indeed, same username and password for both companies.