cancel
Showing results for 
Search instead for 
Did you mean: 

Exe of addon not closing

dilipkumbhar
Participant
0 Kudos

I have developed an addon in SAP B1 PL:08. It is working properly. But when I close SAP, this exe is not closing . I can see it Task Manager. Is there something missing in my code of addon.

DellSC
Active Contributor
0 Kudos

I have changed the tag on your question to SAP Business One where you should be able to get a response. SAP BusinessObjects is not a part of B1, so no one under that tag would likely be able to answer you.

Accepted Solutions (0)

Answers (2)

Answers (2)

dilipkumbhar
Participant
0 Kudos

I have used this code ,

Private Sub SBO_Application_AppEvent(ByVal EventType As SAPbouiCOM.BoAppEventTypes) Handles SBO_Application.AppEvent 
If (EventType = SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged Or EventType = SAPbouiCOM.BoAppEventTypes.aet_LanguageChanged Or _ EventType = SAPbouiCOM.BoAppEventTypes.aet_ServerTerminition Or _ EventType = SAPbouiCOM.BoAppEventTypes.aet_ShutDown) Then
GC.Collect()
System.Windows.Forms.Application.Exit()
End If
End Sub

We have deployed SAP on Azure and we don't have enough licenses. Login details of prod1 SAP user are as follows -

RDP login- prod1

SAP login- prod1

This login is shared by four users. From morning these users start sharing their login and in the afternoon I can find multiple exe's of addon. How do I fix this problem ?

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Dear dilipkumbhar,

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

Private Sub oSBOApplication_AppEvent(ByVal EventTypeAsSAPbouiCOM.BoAppEventTypes) Handles SBO_Application.AppEvent
Select Case EventType
CaseSAPbouiCOM.BoAppEventTypes.aet_ShutDown,SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged,SAPbouiCOM.BoAppEventTypes.a e t_ServerTerminition
'oCompany.Disconnect()
'System.Runtime.InteropServices.Marshal.ReleaseComObject(oCompany)
Application.Exit()
End
End Select
End Sub

Please check SDK help file for more information on AppEvent.

2) In some cases, windows could terminate the exe after a delay (30-60 secs).check whether you have that behavior in the workstation.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support