Skip to Content
0

UI API connection time out B1 Studio

May 08, 2017 at 08:07 AM

73

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member May 08, 2017 at 09:19 AM
0

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

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0
Former Member
Former Member

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

1
Former Member
Former Member

Hello Pedro,

worked like a charm.

Thanks a lot for your solution.

Kind regards,

Dimitris Theotokatos

0