cancel
Showing results for 
Search instead for 
Did you mean: 

Raising a CFL event

Former Member
0 Kudos

Hi,

Is it possible to raise a CFL event in code - without a form being open?

I set up code that will look for a default vendor for a given item. If the item has no default vendor, I need to offer the user a CFL to choose one. The card code of the vendor selected by the user needs to be stored in a string variable for further processing.

Thanks,

Mike

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

To cacth a Code make the following:

In your Item Event:

<i>Select Case pVal.EventType

Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST

Select Case pVal.ItemUID

Case "Your Item with CFL link"

Dim dt As SAPbouiCOM.DataTable

Dim Code,Description As String

dt = GetValueCFL(pVal)

Code = dt.GetValue("CodeField", 0)

Description = dt.GetValue("SlpCode", 0)

</i>

FUNCTION Get Value CFL:

<i> Private Function GetValueCFL(ByVal mypVal As SAPbouiCOM.ItemEvent) As SAPbouiCOM.DataTable

Dim oCFLEvent As SAPbouiCOM.IChooseFromListEvent

Dim sCFL_ID As String

Dim oCFL As SAPbouiCOM.ChooseFromList

Dim oDataTable As SAPbouiCOM.DataTable

oCFLEvent = mypVal

sCFL_ID = oCFLEvent.ChooseFromListUID

oCFL = oForm.ChooseFromLists.Item(sCFL_ID)

oDataTable = oCFLEvent.SelectedObjects

Return oDataTable

End Function</i>

Kind Regards !!

Former Member
0 Kudos

Alejandro,

Thanks for your suggestion. I will give it a try and let you know how well it works.

Mike

Former Member
0 Kudos

Alejandro,

I just realized that your code is for catching a CFL event. This I know how to do. What I need to do is to raise that event myself with code and then I can catch it and process it.

Thanks,

Mike

PS: Anybody know how this can be done?

Answers (0)