Skip to Content

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

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();

}

}

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Oct 16, 2018 at 10:51 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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?

  • Posted on Oct 19, 2018 at 09:12 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.