Welcome Notes

Welcome Viewers

13 April 2017

Bind Current Date SAP B1


Dear All,

   We will see to bind Current Date through DBDataSoruce Using SAP B1 SDK?


Friend Sub BindDate(ByVal oForm As SAPbouiCOM.Form, ByVal oDsName As Object, ByVal dbAlias As Object)
        Dim oDBDataSource As SAPbouiCOM.DBDataSource = Nothing
        oDBDataSource = oForm.DataSources.DBDataSources.Item(oDsName)
        Try
            With oDBDataSource
                ' .SetValue(dbAlias, 1, String2date(Date.Now.ToString("dd-MM-yyyy", CultureInfo.CurrentCulture)))
                .SetValue(dbAlias, 0, DateTime.Today.ToString("yyyyMMdd"))
            End With
        Catch ex As Exception

        End Try

    End Sub

Display ButtonCombo caption SAP B1

Dear All,
   Today , we will see to Display Button Combo Caption through SAP SDK.


   Friend Sub DisplayComboBoxcaption(ByVal oForm As SAPbouiCOM.Form, ByVal butComboUid As String, ByVal butComCaption As String)
        Try

            Dim oComButton As SAPbouiCOM.ButtonCombo = Nothing
            oComButton = oForm.Items.Item(butComboUid).Specific
            If butComCaption = "CopyFrom" Then
                oComButton.Caption = "Copy From"
            ElseIf butComCaption = "CopyTo" Then
                oComButton.Caption = "Copy To"
            End If
        Catch ex As Exception

        End Try


    End Sub

Enable Matrix ArrowKeys SAP B1

Dear All,
   Today we will see to Enable Matrix ArrowKeys through SAP SDK


  Friend Sub EnableMatrixArrowKeys(ByVal oForm As SAPbouiCOM.Form, ByVal oMatrixUID As String)
        Try
            Dim oMatrix As SAPbouiCOM.Matrix = Nothing
            oMatrix = oForm.Items.Item(oMatrixUID).Specific
            Dim oMatrixcomSetting As SAPbouiCOM.CommonSetting = oMatrix.CommonSetting
            oMatrixcomSetting.EnableArrowKey = True


        Catch ex As Exception

        End Try
    End Sub

Set Current Date Matrix Row SAP B1

Dear All,
   Today we will see "How to set Current Date in Matrix Row " using SAP SDK


    ''' <summary>
    ''' To Set Current Date in Matrix Column 
    ''' </summary>
    ''' <param name="oForm">Pass Form Name</param>
    ''' <param name="strMatrixUID">Pass Matrix ID</param>
    ''' <param name="strColUID">Pass Column ID</param>
    ''' <param name="intRowNumber">Pass Row Number</param>
    ''' <remarks></remarks>
    Friend Sub SetCurrentDateInMatrix(ByVal oForm As SAPbouiCOM.Form, ByVal strMatrixUID As String, ByVal strColUID As String, ByVal intRowNumber As Integer)
        Try
            Dim oMatrix As SAPbouiCOM.Matrix = Nothing
            Dim oETDate As SAPbouiCOM.EditText = Nothing
            oMatrix = oForm.Items.Item(strMatrixUID).Specific
            oETDate = oMatrix.Columns.Item(strColUID).Cells.Item(intRowNumber).Specific
            ' oMatrix.Columns.Item(strColUID).Cells.Item(intRowNumber).Specific.Value = String2date(DateTime.Now.ToString("dd-MM-yyyy"))
            oETDate.String = DateTime.Now.ToString("dd-MM-yyyy", CultureInfo.CurrentCulture)


        Catch ex As Exception

        End Try
    End Sub

Bind Document Series SAP B1

Dear All,
   Today we will see "How to Bind Document Series" using SAP B1 SDK?


  Friend Sub BindDocSeries(ByVal oForm As SAPbouiCOM.Form, ByVal oDsName As Object, ByVal dbAlias As Object)

        Dim oDBDataSource As SAPbouiCOM.DBDataSource = Nothing

        oDBDataSource = oForm.DataSources.DBDataSources.Item(oDsName)

        Try

            With oDBDataSource

                .SetValue(dbAlias, 0, "5")

            End With

        Catch ex As Exception



        End Try



    End Sub


Get DataSource Value SAP B1

Dear All,
   Today, we will see How to get DataSource Value in SAP Business One.
Code Here,


    Friend Function GetDataSourceValue(ByVal oForm As SAPbouiCOM.Form, ByVal odbSoruce As Object, ByVal odbAlias As Object) As String

        Dim oDBDataSource As SAPbouiCOM.DBDataSource = Nothing

        Dim strRetValue As String = String.Empty

        oDBDataSource = oForm.DataSources.DBDataSources.Item(odbSoruce)

        With oDBDataSource

            strRetValue = .GetValue(odbAlias, 0)

        End With



        Return strRetValue

    End Function