Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3523

Choose From List a una Child Table

$
0
0

Expertos, gusto en saludarles.

 

Tengo un UDO formado por una tabla @OCEN y una child table [@CEN1], quisiera saber si se puede asignar un choosefromlist con la tabla [@CEN1], el objeto se llama @OCEN. Intente asignar contenido al CFL con un query, pero me indica que el objeto es invalido (el objeto asociado al CFL es OCEN].

Este es el codigo.

oForm = SBO_Application.Forms.ActiveForm

        Dim strQuery = "select t2.u_guiahija,t2.u_itemname from  [@cen1] t2 " _

        & "where (t2.u_estado<>'E' and t2.u_estado<>'F')"

 

 

        Dim oCFL As SAPbouiCOM.ChooseFromList = oForm.ChooseFromLists.Item("CFLCEN")

        Dim oConds As SAPbouiCOM.Conditions

        Dim oCond As SAPbouiCOM.Condition

        Dim oEmptyConds As New SAPbouiCOM.Conditions

 

 

        Dim rsetCFL As SAPbobsCOM.Recordset = compania.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

        oCFL.SetConditions(oEmptyConds)

        oConds = oCFL.GetConditions()

        rsetCFL.DoQuery(strQuery)

        rsetCFL.MoveFirst()

        For i As Integer = 1 To rsetCFL.RecordCount

 

 

            If i = (rsetCFL.RecordCount) Then

                oCond = oConds.Add()

                oCond.Alias = "u_guiahija"

                oCond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

                oCond.CondVal = Trim(rsetCFL.Fields.Item(0).Value)

            Else

                oCond = oConds.Add()

                oCond.Alias = "u_guiahija"

                oCond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

                oCond.CondVal = Trim(rsetCFL.Fields.Item(0).Value)

                oCond.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR

            End If

            rsetCFL.MoveNext()

        Next

 

 

        If rsetCFL.RecordCount = 0 Then

            oCond = oConds.Add()

            oCond.Alias = "u_guiahija"

            oCond.Relationship = SAPbouiCOM.BoConditionRelationship.cr_NONE

            oCond.CondVal = "-1"

 

 

        End If

        oCFL.SetConditions(oConds)

 

Desde ya agradezco su ayuda.

 

SAP B1 9.0 PL 05

 

Carlos Bonilla.


Viewing all articles
Browse latest Browse all 3523

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>