cancel
Showing results for 
Search instead for 
Did you mean: 

CFL

Former Member
0 Kudos

Hi,

How to add CFL thru source code.......

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In the SDK samples (under UI COM) you can find a sample for adding a choose from list.

I will give part of the code here, maybe it will answer your needs:

first define the CFL:


Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
oCFLs = oForm.ChooseFromLists

            Dim oCFL As SAPbouiCOM.ChooseFromList
            Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
            oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)

            ' Adding 2 CFL, one for the button and one for the edit text.
            oCFLCreationParams.MultiSelection = False
            oCFLCreationParams.ObjectType = "2" 'BP
            oCFLCreationParams.UniqueID = "CFL1"

            oCFL = oCFLs.Add(oCFLCreationParams)

Then link your edit text to it:


oForm.DataSources.UserDataSources.Add("EditDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
oItem = oForm.Items.Add("EditTxt", SAPbouiCOM.BoFormItemTypes.it_EDIT)
        oItem.Left = 120
        oItem.Top = 90
        oItem.LinkTo = "StaticTxt"
        oEdit = oItem.Specific
' Adding Choose From List
        oEdit.DataBind.SetBound(True, "", "EditDS")

        ' Adding 2 Choose From List Object, ONE FOR EDIT TEXT AND ONE FOR BUTTON.
        oEdit.ChooseFromListUID = "CFL1"

        'We set the alias only after the UID is set, the alias is the field in the database
        'It compares the value in the edit text and narrows the CFL accrodingly
        oEdit.ChooseFromListAlias = "CardCode"

To see it works, run the full sample.

Hope it helps,

Renana

Former Member
0 Kudos

Hi,

It works well...... Thanx Renena

Regards

Sridhar R

Answers (0)