cancel
Showing results for 
Search instead for 
Did you mean: 

UI API connection time out B1 Studio

Former Member
0 Kudos

Hello everybody,

I have developed an add-on using Business One Studio for Visual Studio and have packed it using the ExtensionPackage tool of SDK(including .exe file, .b1s file and a .b1f file which is a custom form I use). Then I uploaded my add-on using the Extension Manager in manual start up mode. When I run SAP Business One and try to start my add-on from Add-On Manager I get an error saying "Add-on connection timed out.", add-on status is "Failed" but my add-on runs normally.

If I choose to set add-on start up mode "Automatic", then add-on runs with no errors but in Add-On Manager the status is "Connecting" and never changes.

Why is this happening? Is SAP Business One Studio for Visual Studio fault?

Kind regards,

Dimitris Theotokatos

Accepted Solutions (1)

Accepted Solutions (1)

pedro_magueija
Active Contributor
0 Kudos

Hi Dimitris,

Can you post you addon connection code? There was some post regarding the same issue and they were using the development connection string to try to connect. Normally, when in production, you should use the connection string on the command line args.

Perhaps that is the same issue?

Pedro Magueija

LinkedIn | Twitter | Blog

Former Member
0 Kudos

Hello Pedro,

I use SAPBusinessOneSDK.dll so my connection code is

SAPbouiCOM.Framework.Application oApp = new SAPbouiCOM.Framework.Application();
sbo_application = SAPbouiCOM.Framework.Application.SBO_Application;

And after events declaration I use

oApp.Run();

Kind regards,

Dimitris Theotokatos

pedro_magueija
Active Contributor

Hi,

If I'm not mistaken new SAPbouiCOM.Framework.Application(); uses the development connection string.

Extract the connection from the command line arguments and pass it as an argument to the constructor:

private const string DevConnString = @"0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056";
private string GetConnectionString()
{
    var args = Environment.GetCommandLineArgs();


    if (args.Length < 2 || !args[0].Contains("SAP Business One"))
    {
        return DevConnString;
    }


    return args[1];
}
SAPbouiCOM.Framework.Application oApp = new SAPbouiCOM.Framework.Application(GetConnectionString());

Pedro Magueija

LinkedIn | Twitter | Blog

Former Member
0 Kudos

Hello Pedro,

worked like a charm.

Thanks a lot for your solution.

Kind regards,

Dimitris Theotokatos

Answers (0)