Welcome Notes

Welcome Viewers

09 March 2018

Update Path Admin through SDK

Dear All,
   Today , We will see, How to Update Path Admin through SDK



Public Function UpdatePathAdmin(ByVal WordTemplateFolderPath As String, ByVal PicturesFolderPath As String, ByVal AttachmentsFolderPath As String, ByVal ExtensionsFolderPath As String) As Boolean
        Dim oCompanyService As SAPbobsCOM.CompanyService = Nothing
        Dim oPathAdmin As SAPbobsCOM.PathAdmin = Nothing
        oCompanyService = oApp.SAPCompany.GetCompanyService

        Try
            If Not String.IsNullOrEmpty(WordTemplateFolderPath) Then
                oPathAdmin.WordTemplateFolderPath = WordTemplateFolderPath
            Else
                oPathAdmin.WordTemplateFolderPath = oPathAdmin.WordTemplateFolderPath
            End If
            If Not String.IsNullOrEmpty(PicturesFolderPath) Then
                oPathAdmin.PicturesFolderPath = PicturesFolderPath
            Else
                oPathAdmin.PicturesFolderPath = oPathAdmin.PicturesFolderPath
            End If
            If Not String.IsNullOrEmpty(AttachmentsFolderPath) Then
                oPathAdmin.AttachmentsFolderPath = AttachmentsFolderPath
            Else
                oPathAdmin.AttachmentsFolderPath = oPathAdmin.AttachmentsFolderPath
            End If
            If Not String.IsNullOrEmpty(ExtensionsFolderPath) Then
                oPathAdmin.ExtensionsFolderPath = ExtensionsFolderPath
            Else
                oPathAdmin.ExtensionsFolderPath = oPathAdmin.ExtensionsFolderPath
            End If
            oCompanyService.UpdatePathAdmin(oPathAdmin)
            Return True
        Catch ex As Exception
            Return False
        Finally
            If oCompanyService IsNot Nothing Then
                oCompanyService = Nothing
            End If
        End Try
    End Function

Get System Currency through SAP Business one SDK

Dear All,
   Today , We will see, How to Get System Currency through SDK


  Public Function GetSysCurrency() As String
        Dim vObj As SAPbobsCOM.SBObob = Nothing
        oApp = New ClsSAPConn
        Dim oRS As SAPbobsCOM.Recordset
        Dim strSysCurrency As String = String.Empty
        vObj = oApp.SAPCompany.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)
        oRS = oApp.SAPCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
        Try
            oRS = vObj.GetSystemCurrency()
            strSysCurrency = oRS.Fields.Item(0).Value
        Catch ex As Exception
            strSysCurrency = String.Empty
        Finally
            If vObj IsNot Nothing Then
                vObj = Nothing
            End If
            System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS)
            If oApp IsNot Nothing Then
                oApp = Nothing
            End If
        End Try
        Return strSysCurrency
    End Function