cancel
Showing results for 
Search instead for 
Did you mean: 

UI SDK:Call Native VB form from SAP eventhandler

Former Member
0 Kudos

Hi all

I am trying to call a native Visual Basic form (ie a form that does not run within SAP Business one but as an ordinary windows window) from a menu added to SAP BO with UI SDK.

In my menu event handler for my SAP BO application I instantiate the form and show it:

Private Sub con_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent

Select Case pVal.MenuUID

Case "NewMenu"

If pVal.BeforeAction = True Then

myForm = New Form1()

myForm.show()

End If

End Select

End Sub

Only the window is created; the form is not populated, ie I have a "dead" window without the buttons etc that I've created on the form.

If I do

myForm = New Form1()

myForm.show()

in my main application (not in the eventhandler) it works fine.

Any good ideas?

Regards

Jesper Carstensen

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

It is something to do with the .NET environment.

In VB6 it works fine with the event handler.

I think the problem is with subscribing twice to get system events (both forms in same process + SAP Business One Application object)

two solutions:

1. Change the oForm.Show() to oForm.ShowDialog().

2. Open the form in a different process.

Regards,

Yaniv G.

SDK Consultant,

SAP Manage Israel.