Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8451

Re: SDK Connection Settings Question

$
0
0

Hi Edward,

 

Access to the event you mentioned requires a UI API connection. Placing a connection on the event is a bad idea (you'll be connection everytime the event is triggered, soon you'll run out of memory).

 

Assuming you already have the UI API connection you can pull the company object from that connection:

 

try

{

    var gui = new SboGuiApi();

    gui.Connect(connectionString);

    application = gui.GetApplication();

    company = new Company { Application = application };

    company.Connect();

}

catch (COMException e)

{

    throw ConnectionException.CreateFrom(e);

}

 

Best practice to establish connection to SAP Business One is at the addon startup. Should be the very first thing you do. Store the reference to your company and application objects (perhaps in a globally accessible place) and you should be fine.

 

Good luck.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn


Viewing all articles
Browse latest Browse all 8451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>