How to use CFL in Business Partners Master in Find Mode
I have a problem in Business Partners Master Form. I need add conditions in Choose From List in Find Mode when I set an asterisk in the CardCode TextField for filtering the businnes partners list.
When I capture the et_CHOOSE_FROM_LIST itemEvent in BeforeAction, I can't get the ChooseFromList ID for adding the conditions in the ChooseFromList Object.
Public Sub ItemEvent(ByVal FormUID As String, pVal As SAPbouiCOM.IItemEvent, BubbleEvent As Boolean)
Select Case pVal.EventType
Dim lcflE As SAPbouiCOM.ChooseFromListEvent
Dim id As String
Set lcflE = pVal
id = lcflE.ChooseFromListUID -> The ID is "-1"
Thank's in advance
Yatsea Li replied
if you can't get it via lcflE.ChooseFromListUID -> The ID is "-1",I guess you need to know choosefromlist UID by test one by one with oForm.ChooseFromLists.Item(i). Or you can save the fom as xml then chech the CFL UID.
If pVal.FormType = 139 And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then If pVal.ItemUID = "4" Then If pVal.InnerEvent And pVal.Before_Action Then BubbleEvent = False Dim oForm As SAPbouiCOM.Form oForm = SBO_Application.Forms.Item(FormUID) Dim oCons As SAPbouiCOM.Conditions Dim oCFL As SAPbouiCOM.ChooseFromList 'oCFL = oCFLs.Add(oCFLCreationParams) oCFL = oForm.ChooseFromLists.Item("2") 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 BubbleEvent = True End If End If End If