cancel
Showing results for 
Search instead for 
Did you mean: 

While using addon in SAP B1 Browser if user exit also addon running in backend.

0 Kudos

if addon runs in Offline below functionality working fine. If using in Browser only having this problem. If 1 user connected also in task manager addon will showing 6 times.

Actually i included below event in my code still i'm having the problem

private void oApplication_AppEvent(SAPbouiCOM.BoAppEventTypes EventType)

{

if (EventType == SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged || EventType == SAPbouiCOM.BoAppEventTypes.aet_LanguageChanged || EventType == SAPbouiCOM.BoAppEventTypes.aet_ServerTerminition || EventType == SAPbouiCOM.BoAppEventTypes.aet_ShutDown)

{

GC.Collect();

System.Windows.Forms.Application.Exit();

}

}

Accepted Solutions (0)

Answers (2)

Answers (2)

edy_simon
Active Contributor
0 Kudos

Hi,

The browser client is always running in the server gateway.
Eventhough a client exit the browser, the SAP Business One Client process is never closed.
That is why your addon is not shut down.

This is by design, the client process will be waiting for another user to login and re-use its process.

Regards

Edy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Manimekalai S,

When SAP Business One Client in closed, events are generated for add-on exe to exit. Below code should be employed in the add-on to close the add-on exe.

Private Sub oSBOApplication_AppEvent(ByVal EventType As SAPbouiCOM.BoAppEventTypes)Handles SBO_Application.AppEvent
Select Case EventType
Case SAPbouiCOM.BoAppEventTypes.aet_ShutDown,SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged, SAPbouiCOM.BoAppEventTypes.aet_ServerTerminition

'Some handling logic
Application.Exit()
End
End Select
End Sub

2.) If you have already implemented above, check whether you have any code for statusBar as below.Please remove the statusBar.SetText and then check.

SBO_Application.StatusBar.SetText("Terminating add-on...", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_None)

If the above does not resolve the issue,please provide further information.

1. SAP Business One version used.

2. SDK DLL version (SAPbobsCOM & SAPbouiCOM) on which the add-on is build.

3. Share the code used in your add-on for the oSBOApplication_AppEvent

4. Do you see the same behavior, when you run the add-on on SAP Business One Client?

5. Check whether there are any error messages recorded in the Windows event viewer on the Browser access machine.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

0 Kudos

Hi ANKIT CHAUHAN,

Thanks for reply.

For your Information

1) SAP B1 Version: 9.2 PL 09

2) DLL : 9.0

3) Code in AppEvent

oApplication_AppEvent(SAPbouiCOM.BoAppEventTypes EventType)

{

if (EventType == SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged || EventType == SAPbouiCOM.BoAppEventTypes.aet_LanguageChanged || EventType == SAPbouiCOM.BoAppEventTypes.aet_ServerTerminition || EventType == SAPbouiCOM.BoAppEventTypes.aet_ShutDown)

{

GC.Collect();

System.Windows.Forms.Application.Exit();

}

}

4) In Offline, while user click Exit or Close Button Addon disconnecting automatically and also SAP getting shutdown properly.

But the same addon while using in Browser, in Task Manager it showing 3 times. if user click Exit or Close Button in Browser screen SAP getting shutdown but in Task Manager still addon running (didn't disconnecting automatically).Just i include status message and checked if AppEvent Trigger or not while close from Browser. Event also calling. But addon not disconnected.

Normally, For Addon disconnection we using Application.Exit()

Is their any other way to disconnect addon while using browser?