Skip to Content
0
Former Member
Mar 26, 2009 at 10:28 AM

Return value from cfl in a matrix cell by dbdatasource

241 Views

I have developed a form via B1DE and Screen Painter

I have assign the cfl via screen painter

the event code is given bellow

the problem is setvalue function is not working as getvalue is working properly

<B1Listener(BoEventTypes.et_CHOOSE_FROM_LIST, False)> _

Public Overridable Sub OnAfterChooseFromList(ByVal pVal As ItemEvent)

'Public Overridable Sub OnAfterChooseFromList(ByVal pVal As ItemEvent)

Dim ActionSuccess As Boolean = pVal.ActionSuccess

Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)

Dim item As Item = form.Items.Item("mtx_0")

Dim matrix As Matrix = CType(item.Specific, Matrix)

'ADD YOUR ACTION CODE HERE ...

If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then

Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent

oCFLEvento = pVal

Dim sCFL_ID As String

sCFL_ID = oCFLEvento.ChooseFromListUID

Dim oForm As Form = form

Dim oCFL As SAPbouiCOM.ChooseFromList

oCFL = oForm.ChooseFromLists.Item(sCFL_ID)

If oCFLEvento.BeforeAction = False Then

Dim oDataTable As SAPbouiCOM.DataTable

oDataTable = oCFLEvento.SelectedObjects

Dim val As String

val = CStr(oDataTable.GetValue(0, 0))

///////////**************/////////////////// I want to put value in Matrix Current Row

form.DataSources.DBDataSources.Item("@PRQ1").SetValue("U_itemcode", pVal.Row, CStr(val))

//////////***************/////////////////// Nothing is shown in the matrix

but

form.DataSources.DBDataSources.Item("@PRQ1").getValue("U_itemcode", pVal.Row - 1)

''''''''''Getvalue method is getting the right value from the matrix

''''''''''but Setvalue us not working properly no data is shown

Please help into this matter as i want to return a selected value from cfl into the matrix

Best Regards,

Umer Nasim