on 04-11-2006 2:13 PM
Hi,
i'm using quiet simple code. After loading the form Production Order i wish to create a new tab on the system form.
But i got 2 problems:
1. when the system reach the code line where it gets the system form with getFormbyTypeandCount (here the last line of the procedure) something happens and the following code won't be read.
2. after getFormbyTypeandCount no event is fired anymore.
Does anybody have an idea whats going wrong?
Private Sub moSBOApplication_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles moSBOApplication.ItemEvent
'Events verarbeiten
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD
'Montageauftrag
If pVal.FormType = 65211 And pVal.Before_Action = False Then
createTabDepend(pVal)
End If
End Select
End Sub
#Region "design tab 'abhängige Aufträge'"
Private Sub createTabDepend(ByRef pval As SAPbouiCOM.ItemEvent)
Dim oRecSet As SAPbobsCOM.Recordset
Dim oForm As SAPbouiCOM.Form
Dim oItem As SAPbouiCOM.Item
Dim oNewItem As SAPbouiCOM.Item
Dim oBtn As SAPbouiCOM.Button
Dim oFolder As SAPbouiCOM.Folder
Dim oText As SAPbouiCOM.StaticText
Dim oCheck As SAPbouiCOM.CheckBox
Dim oMatrix As SAPbouiCOM.Matrix
Dim oColumns As SAPbouiCOM.Columns
Dim oColumn As SAPbouiCOM.Column
Dim oDBDataSource As SAPbouiCOM.DBDataSource
oForm = moSBOCompany.Forms.GetFormByTypeAndCount(pval.FormType, pval.FormTypeCount)
best regards
Markus
Hi Markus,
Why don't you get the form on the form load event and then pass the form as a parameter to your method?
e.g
Private Sub moSBOApplication_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles moSBOApplication.ItemEvent
'Events verarbeiten
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD
'Montageauftrag
If pVal.FormType = 65211 And pVal.Before_Action = False Then
oForm = moSBOCompany.Forms.GetFormByTypeAndCount(pval.FormType, pval.FormTypeCount)
createTabDepend(pVal, form)
End If
End Select
End Sub
Regards, Lita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Markus,
why don't you do this
oForm = moSBOCompany.Forms.item(pval.formUID)
this is the best way to uniquely select a form.
Regards
Ad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.