on 04-08-2008 11:57 AM
Hi,
How to add CFL thru source code.......
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
10 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.