You can use the current session to make connections to BOs either through the adapter approach or directly to the BO.
For example if you wanted to access the salesorder adapter from the BOL Entry screen.
Dim adSales As SalesOrderAdapter = New SalesOrderAdapter("BOLForm")
adSales.BOConnect()
Dim result As Boolean = adSales.BOConnect()
' do something with it
adSales.Dispose()
To work directly with the BO instead, similar to how things work via the BL Tester. You can use the Session property to get the needed information. Only have a C# example at the moment, there is a quirk/bug in 9 in that you can't get the reference to the session directly hence the extra step.
// need to cast the session property before using it
Epicor.Mfg.Core.Session s = (Epicor.Mfg.Core.Session)SalesOrderTrackerForm.Session;
SchedulingBoardBO = new Epicor.Mfg.BO.SchedulingBoard(s.ConnectionPool);
Jim Kinneman
Senior Consultant
Encompass Solutions, Inc
For example if you wanted to access the salesorder adapter from the BOL Entry screen.
Dim adSales As SalesOrderAdapter = New SalesOrderAdapter("BOLForm")
adSales.BOConnect()
Dim result As Boolean = adSales.BOConnect()
' do something with it
adSales.Dispose()
To work directly with the BO instead, similar to how things work via the BL Tester. You can use the Session property to get the needed information. Only have a C# example at the moment, there is a quirk/bug in 9 in that you can't get the reference to the session directly hence the extra step.
// need to cast the session property before using it
Epicor.Mfg.Core.Session s = (Epicor.Mfg.Core.Session)SalesOrderTrackerForm.Session;
SchedulingBoardBO = new Epicor.Mfg.BO.SchedulingBoard(s.ConnectionPool);
Jim Kinneman
Senior Consultant
Encompass Solutions, Inc
--- In vantage@yahoogroups.com, "ross_edinburgh" <ross_edinburgh@...> wrote:
>
> Hi ,
>
> What's the best way of using the current connection / getting the users session as I have only tried creating a new connection as follows:
>
> Private conepr As New Epicor.Mfg.Core.BLConnectionPool("account", "password", "AppServerDC://server:8331") 'Pilot
>
> Private objSO As New Epicor.Mfg.BO.SalesOrder(conepr)
>
> This works but uses up a licence and as you mentioned the ability to piggy-back on the current session this would be a better way of doing it. Have you got an example code snippet on how I can use the current user session. It would be appreciated.
>
> Thanks again.
>
> Cheers,
>
> Ross
>
>
> --- In vantage@yahoogroups.com, Mark Wonsil <mark_wonsil@> wrote:
> >
> > Brian wrote:
> > > You could write an "extension" for Vantage that you could launch with
> > > a button click, that you could pass information to, which would launch a
> > > Vantage session, do stuff, and show the results in your custom
> > > extension. It wouldn't happen in the context of the users' session,
> > > which could lead to some license consumption issues, but only if you
> > > were getting close to using up your concurrent licenses anyways.
> >
> > Your custom code should be able to piggy-back on the current session
> > without starting a new one.
> >
> > With the current Load Library vulnerabilities that's causing many
> > updates these days makes me wonder if Epicor/Vantage are
> > susceptible...
> >
> > You would also want to do the custom client thingy to make sure that
> > the most up-date-date version of your dll was pushed out to the
> > clients...
> >
> > Mark W.
> >
>