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