Skip to Content

Hello,

In This Blog I am trying to Cover following concepts

  1. How To Add Checkbox “Instrument” in Item Master Data Form Below Purchase Item.
  2. How To Add TAB/Folder Control “QC Group” in Item Master Data Form After Planning Data.
  3. Adding Controls in User Defined TAB/Folder Control
  4. Adding Controls in SAP Business One System TAB on Item Master Data Form. Added One Field “Test” in Inventory TAB Of Item Master Data.

Output Screen will be as follows

 

 

Write Following Code in Item Event.

 

Public Sub ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean)
        If pVal.BeforeAction Then
        Else
            Select Case pVal.EventType
                Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
                    'QC Group - Folder (TAB) Control - Pane Level Setting
                    If pVal.ItemUID = "fldQC" Then
                        GOD_Form = GOD_Main.GOD_Application.Forms.GetForm("150", pVal.FormTypeCount)
                        GOD_Form.PaneLevel = 1000
                    End If
                Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD
                    Try
                        GOD_Form = GOD_Main.GOD_Application.Forms.GetForm("150", pVal.FormTypeCount)
                        Dim GOD_Folder As SAPbouiCOM.Folder = Nothing
                        Dim GOD_Item As SAPbouiCOM.Item
                        Dim GOD_ItemRef As SAPbouiCOM.Item = Nothing
                        GOD_ItemRef = GOD_Form.Items.Item("27")
                        GOD_Item = GOD_Form.Items.Add("fldQC", SAPbouiCOM.BoFormItemTypes.it_FOLDER)
                        GOD_Item.Top = GOD_ItemRef.Top
                        GOD_Item.Height = GOD_ItemRef.Height
                        GOD_Item.Left = GOD_ItemRef.Left + GOD_ItemRef.Width
                        GOD_Item.Width = GOD_ItemRef.Width
                        GOD_Item.Visible = True
                        GOD_Folder = GOD_Item.Specific
                        GOD_Folder.Caption = "QC Details"
                        GOD_Folder.GroupWith(GOD_ItemRef.UniqueID)
                        GOD_Folder.Pane = 1000

                        'Adding QC Module Fields 
                        GOD_Item = GOD_Form.Items.Add("lblQCGrp", SAPbouiCOM.BoFormItemTypes.it_STATIC)
                        GOD_Item.FromPane = 1000
                        GOD_Item.ToPane = 1000
                        GOD_Item.Top = GOD_Form.Items.Item("122").Top
                        GOD_Item.Left = GOD_Form.Items.Item("122").Left
                        GOD_Item.Width = GOD_Form.Items.Item("122").Width
                        GOD_Item.Height = GOD_Form.Items.Item("122").Height
                        GOD_Static = GOD_Item.Specific
                        GOD_Static.Caption = "QC Group Code"

                        GOD_Item = GOD_Form.Items.Add("lblQCGrpNm", SAPbouiCOM.BoFormItemTypes.it_STATIC)
                        GOD_Item.FromPane = 1000
                        GOD_Item.ToPane = 1000
                        GOD_Item.Top = GOD_Form.Items.Item("lblQCGrp").Top + GOD_Form.Items.Item("lblQCGrp").Height '+ 1
                        GOD_Item.Left = GOD_Form.Items.Item("lblQCGrp").Left
                        GOD_Item.Width = GOD_Form.Items.Item("lblQCGrp").Width
                        GOD_Item.Height = GOD_Form.Items.Item("lblQCGrp").Height
                        GOD_Static = GOD_Item.Specific
                        GOD_Static.Caption = "QC Group Name"

                        Dim GOD_CheckBox As SAPbouiCOM.CheckBox
                        GOD_Item = GOD_Form.Items.Add("chkInst", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX)
                        GOD_Item.FromPane = GOD_Form.Items.Item("12").FromPane
                        GOD_Item.ToPane = GOD_Form.Items.Item("12").ToPane
                        GOD_Item.Top = GOD_Form.Items.Item("12").Top + GOD_Form.Items.Item("12").Height '+ 1
                        GOD_Item.Left = GOD_Form.Items.Item("12").Left
                        GOD_Item.Width = GOD_Form.Items.Item("12").Width
                        GOD_Item.Height = GOD_Form.Items.Item("12").Height
                        GOD_CheckBox = GOD_Item.Specific
                        GOD_CheckBox.DataBind.SetBound(True, "OITM", "U_isinst")
                        GOD_CheckBox.Caption = "Instrument"

                        'Adding Edit Text Fields
                        GOD_Item = GOD_Form.Items.Add("edQCGrp", SAPbouiCOM.BoFormItemTypes.it_EDIT)
                        GOD_Item.FromPane = 1000
                        GOD_Item.ToPane = 1000
                        GOD_Item.Top = GOD_Form.Items.Item("lblQCGrp").Top
                        GOD_Item.Left = GOD_Form.Items.Item("114").Left
                        GOD_Item.Width = GOD_Form.Items.Item("114").Width
                        GOD_Item.Height = GOD_Form.Items.Item("114").Height
                        GOD_Edit = GOD_Item.Specific
                        GOD_Edit.DataBind.SetBound(True, "OITM", "U_QCGrp")

                        GOD_Item = GOD_Form.Items.Add("edQCGrpNm", SAPbouiCOM.BoFormItemTypes.it_EDIT)
                        GOD_Item.FromPane = 1000
                        GOD_Item.ToPane = 1000
                        GOD_Item.Top = GOD_Form.Items.Item("lblQCGrpNm").Top
                        GOD_Item.Left = GOD_Form.Items.Item("114").Left
                        GOD_Item.Width = GOD_Form.Items.Item("114").Width
                        GOD_Item.Height = GOD_Form.Items.Item("114").Height
                        GOD_Edit = GOD_Item.Specific
                        GOD_Edit.DataBind.SetBound(True, "OITM", "U_QCGrpNam")

                        'Adding Test CheckBox In Inventory TAB
                        GOD_Item = GOD_Form.Items.Add("chkTest", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX)
                        GOD_Item.FromPane = GOD_Form.Items.Item("80").FromPane
                        GOD_Item.ToPane = GOD_Form.Items.Item("80").ToPane
                        GOD_Item.Top = GOD_Form.Items.Item("80").Top + GOD_Form.Items.Item("80").Height '+ 1
                        GOD_Item.Left = GOD_Form.Items.Item("80").Left - 3
                        GOD_Item.Width = GOD_Form.Items.Item("80").Width
                        GOD_Item.Height = GOD_Form.Items.Item("80").Height
                        GOD_CheckBox = GOD_Item.Specific
                        GOD_CheckBox.Caption = "Test"
                    Catch ex As Exception
                        GOD_Main.GOD_Application.MessageBox(ex.Message)
                    End Try
            End Select
        End If
    End Sub

 

Thanks and Regards,

Mahendrakumar

 

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Ricardo Moreno

    Hi.

    I ran into an error in line: GOD_Static = GOD_Item.Specific

    I Change it for:

    GOD_Static = (SAPbouiCOM.StaticText)GOD_Item.Specific;

    Conitue error:

    Erro:Severity Code Description Project File Line Suppression StateSeverity Code Description Project File Line Suppression StateError CS0656 Missing compiler required member ‘Microsoft.CSharp.RuntimeBinder.Binder.Convert’ TestProject C:\Program Files (x86)\SAP\SAP Business One SDK\Samples\COM UI\CSharp\TestProject\HelloWorld.cs 161 Active

     

     

    (0) 

Leave a Reply