Hello, I trying to open a system form and set its mode = fm_FIND_MODE, the problem is that the form opens in fm_ADD_MODE i can change it to modes like fm_OK_MODE, fm_EDIT_MODE... but if i try with fm_EDIT_MODE the execution locks in that instruction.
Here de code (VB.Net):
Private WithEvents SBO_Application As SAPbouiCOM.Application
Dim SboGuiApi As SAPbouiCOM.SboGuiApi
Dim sConnectionString As String
SboGuiApi = New SAPbouiCOM.SboGuiApi
sConnectionString = "0030002C0030002C00530041005000420044005F00440061007" _
& "400650076002C0050004C006F006D0056004900490056"
'// connect to a running SBO Application
Try ' If there's no active application the connection will fail
SboGuiApi.Connect(sConnectionString)
Catch ' Connection failed
System.Windows.Forms.MessageBox.Show("No SAP Business One Application was found")
End Try
SBO_Application = SboGuiApi.GetApplication()
SBO_Application.ActivateMenuItem("2051")
Dim form2 As SAPbouiCOM.Form = SBO_Application.Forms.ActiveForm
form2.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE <- locks here