Welcome Notes

Welcome Viewers
Showing posts with label DataBind. Show all posts
Showing posts with label DataBind. Show all posts

02 March 2018

Bind Current Date through SDK

Dear All,
   Today , We will see, How to Bind Current Date in Edit Text through SDK



Public 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, 0, DateTime.Today.ToString("yyyyMMdd"))
            End With
        Catch ex As Exception
        End Try
    End Sub

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

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

30 December 2015

Get Remarks of Item Code using SAP Business one Studio Suite

Get Remarks of Item Code using SAP Business one Studio Suite


  Private Sub GetRemarksofItemcode()  
       Dim oRsOITM As SAPbobsCOM.Recordset = Nothing  
       Dim strQuery As String = String.Empty  
       Dim strItemCode As String = String.Empty  
       Dim oCell As SAPbouiCOM.Cell  
       Dim oEditText As SAPbouiCOM.EditText  
       Dim oCol As SAPbouiCOM.Column  
       oRsOITM = oApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)  
       For index As Integer = 1 To Matrix0.VisualRowCount  
         oCol = Matrix0.Columns.Item("7")  
         oCell = oCol.Cells.Item(index)  
         oEditText = DirectCast(oCell.Specific, SAPbouiCOM.EditText)  
         'strItemCode = DirectCast(Matrix0.Columns.Item("7").Cells.Item(index).Specific, SAPbouiCOM.EditText).Value.Trim()  
         strItemCode = oEditText.String  
         strQuery = "Select ValidComm from OITM where Itemcode='" & strItemCode & "'"  
         oRsOITM.DoQuery(strQuery)  
         If oRsOITM.RecordCount > 0 Then  
           SetMatrixValues(Matrix0, "u_ea_Remarks", index, oRsOITM.Fields.Item("ValidComm").Value)  
         Else  
           SetMatrixValues(Matrix0, "u_ea_Remarks", index, String.Empty)  
         End If  
   
       Next  
     End Sub