Welcome Notes

Welcome Viewers

11 March 2018

A Step-by-Step Tutorial on Getting Item Alias Names through SDK

            To retrieve an Item Alias Name using the SAP Business One SDK in VB.NET, you can use the following code snippet



 Public Function GetItemAliasName(ByVal SBO_Application As SAPbouiCOM.Application, ByVal oFormType As String, ByVal strItemUid As String, Optional ByVal strColUid As String = "") As String
        Dim resource As SAPbouiCOM.ResourceData = Nothing
        Dim oFormInfo As SAPbouiCOM.FormInfo = Nothing
        Dim oItemInfo As SAPbouiCOM.ItemInfo = Nothing
        Dim strFormType As String = String.Empty
        resource = SBO_Application.ResourceData
        oFormInfo = resource.GetFormInfo(oFormType)
        Try
            oItemInfo = oFormInfo.GetItemInfo(strItemUid, strColUid)
            strFormType = oItemInfo.Alias.Trim
        Catch ex As Exception
            strFormType = String.Empty
        Finally
            If resource IsNot Nothing Then
                resource = Nothing
            End If
            If oFormInfo IsNot Nothing Then
                oFormInfo = Nothing
            End If
            If oItemInfo IsNot Nothing Then
                oItemInfo = Nothing
            End If
        End Try
        Return strFormType.Trim

    End Function