Welcome Notes

Welcome Viewers

12 April 2017

Matrix CFL SAP B1


Dear All,
   Today ,we will see to set CFL in Matrix through SAP B1 SDK.

''' <summary>
    ''' Get CFL Data and Display Matrix  [Change Name MatrixDisplayCFL  To DisplayCFLToMatrix] On 06.01.2017

    ''' </summary>

    ''' <param name="oForm">Pass Form Name</param>

    ''' <param name="oMatrix">Pass Matrix</param>

    ''' <param name="itemUID">Pass Matrix Unique ID</param>

    ''' <param name="colName">Pass Column Name</param>

    ''' <param name="pVal">Refer Item Event</param>

    ''' <returns></returns>

    ''' <remarks></remarks>

    Friend Function DisplayCFLToMatrix(ByVal oForm As SAPbouiCOM.Form, ByVal oMatrix As SAPbouiCOM.Matrix, ByVal itemUID As String, ByVal colName As String, ByRef pVal As SAPbouiCOM.ItemEvent) As String

        Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent = Nothing

        Dim oCFL As SAPbouiCOM.ChooseFromList = Nothing

        Dim sCHFL_ID As String = String.Empty

        Dim val As String = String.Empty

        Dim oDataTable As SAPbouiCOM.DataTable = Nothing

        Try

            oCFLEvento = pVal

            sCHFL_ID = oCFLEvento.ChooseFromListUID

            oCFL = oForm.ChooseFromLists.Item(sCHFL_ID)

            If (oCFLEvento.BeforeAction = False) Then

                oDataTable = oCFLEvento.SelectedObjects

                Select Case pVal.ItemUID

                    Case itemUID

                        oMatrix = oForm.Items.Item(itemUID).Specific

                        val = oDataTable.GetValue(colName, 0)

                End Select

            End If

        Catch ex As Exception

        Finally

            oDataTable = Nothing

            oCFLEvento = Nothing

            oCFL = Nothing

        End Try

        Return val

    End Function