cancel
Showing results for 
Search instead for 
Did you mean: 

Getting SAPbobsCOM.Company object

Former Member
0 Kudos

Hi everybody,

Is it possible to get a SAPbobsCOM.Company object (DI API) from the Application object (UI API) witch is got using the single sign on.

Help appreciated

Thx

Mongi HAMMAMI

Accepted Solutions (1)

Accepted Solutions (1)

olivier_huet3
Participant
0 Kudos

Of course.

Example :


            'SBOapp = SboGuiApi.GetApplication()

            SBOcomp = New SAPbobsCOM.Company
            sCookie = SBOcomp.GetContextCookie
            sConnectionContext = SBOapp.Company.GetConnectionContext(sCookie)

            If SBOcomp.Connected Then SBOcomp.Disconnect()

            If SBOcomp.SetSboLoginContext(sConnectionContext) = 0 Then
                        If SBOcomp.Connect Then
                                'connection is ok
                        Else
                               'connection failed
                         End If
            Else
                           'failed to get context...     
            End If

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Thx for help

It works using the single sign on

Former Member
0 Kudos

Hi Mongi,

If you used single sign on you already declared a company variable and should just be able to use it from there on. There is no need to get the company object from the application object. If you only connected using the UI (Application object), you will not be able to use the company interface (DI) and should connect seperately to a company object. Best is to use single sign on if you're using both DI and UI.

Hope it helps,

Adele