cancel
Showing results for 
Search instead for 
Did you mean: 

While trying to select an item from another form , choose item is not displayed in the main form

Former Member
0 Kudos

Hi,

While trying to select an item from another form , choose item is not displayed in the main form.

The following event is not triggered, due to this it is not able to choose the item from another form

oItem = oForm.Items.Item("txtsearch")

    txtsearch = oItem.Specific

txtsearch.DataBind.SetBound(True, "", "BP")

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 SAPbouiCOM.Form

                oForm = SBO_Application.Forms.Item(FormUID)

                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

                    Try

                        val = oDataTable.GetValue(0, 0)

                    Catch ex As Exception

                    End Try

                    If (pVal.ItemUID = "20") Then

                        oForm.DataSources.UserDataSources.Item("BP").ValueEx = val

                    End If

                End If

Please advice on this

Thanks,

Satish.

Accepted Solutions (0)

Answers (1)

Answers (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Please repost above discussion in SDK forum.

http://scn.sap.com/community/business-one-sdk

Close this thread here with helpful answer.

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi,

Plz check this

                Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST

                    objForm = objMain.objUtilities.GetForm(FormUID)

                    Dim oCFL As SAPbouiCOM.ChooseFromList

                    Dim CFLEvent As SAPbouiCOM.IChooseFromListEvent = pVal

                    Dim CFL_Id As String

                    CFL_Id = CFLEvent.ChooseFromListUID

                    oCFL = objForm.ChooseFromLists.Item(CFL_Id)

                    Dim oDT As SAPbouiCOM.DataTable

                    oDT = CFLEvent.SelectedObjects

                    If Not (oDT Is Nothing) And pVal.BeforeAction = False Then

                        If oCFL.UniqueID = "EMP1CFL" Then

                            oDBs_Head.SetValue("U_ShfInchrg", 0, oDT.GetValue("firstName", 0))

                        End If

                        If oCFL.UniqueID = "EMPCFL" Then

                            oDBs_Head.SetValue("U_PlntInchrg", 0, oDT.GetValue("firstName", 0))

                        End If

                        If objForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE Then

                            objForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE

                        End If

                    End If