cancel
Showing results for 
Search instead for 
Did you mean: 

Choose From List

Former Member
0 Kudos

I've created a form that allows a user to search for customers and also add them. When the form is in Find Mode I need it so that once the user has entered all of the search criteria and clicked on the Find button that the BP Search form 10001 is shown displaying the results.

The problem I am having is not with populating the data but getting the form to show when I want it to. Is there any way that I can get the form to show containing the search results without clicking on a Choose From List button, which is the only way I have experience of doing it.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Steven,

Then how would you like to trigger to show the form? What is expected for the user to do, then the form is displayed? Thanks.

Kind Regards

-Yatsea

Former Member
0 Kudos

Once the find button is pressed I have code that creates an SQL query which it uses to check for any matches within the database with the user's request. If there is more than one result then the results should be shown in the 10001 form allowing the user to choose the one they would like to output on the form.

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Steven,

Now I understand the scenario now, atually you can set the condition for ChooseFromList (Form 10001)

but SQL is not allowed to set the choose from list. Here is the sample code:

If pVal.FormType = 134 And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.Before_Action = True Then
            If pVal.ItemUID = "1" Then
                Dim oForm As SAPbouiCOM.Form
                oForm = oApp.Forms.Item(FormUID)
                If oForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE Then
                    Dim oCons As SAPbouiCOM.Conditions
                    Dim oCFL As SAPbouiCOM.ChooseFromList
                    'You may need to check the UID for BP choose List here
                    oCFL = oForm.ChooseFromLists.Item("1")

                    oCons = oCFL.GetConditions()
                    'Note: Add the condition only once. 
                    If 0 = oCons.Count Then
                        Dim oCon As SAPbouiCOM.Condition
                        oCon = oCons.Add()
                        oCon.Alias = "Cardcode"
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                        oCon.CondVal = "C0001"
                        'Set your own condition here instead of the system conditions
                        oCFL.SetConditions(oCons)
                    End If

                End If
            End If
        End If

Kind Regards

-Yatsea

Former Member
0 Kudos

Yatsea

I've tried using that code in my project but I keep getting the error:

Invalid Choose From List [66000-104] when it reaches the line:

oCFL = oForm.ChooseFromLists.Item("2")

Edited by: Steven Tryner on Nov 11, 2008 12:07 PM

Former Member
0 Kudos

hi,

even i tried to get control of CFL when you click on find button when a perticular form is in find mode.

but, it is not possible.

regards,

varma

Former Member
0 Kudos

Couldn't I just changed the mode to update mode just before I use the CFL code.

Former Member
0 Kudos

Is there any other way I would be able to show and populate the 10001 form and then allow for a record to be chosen and loaded into my form?