Experts,
I'm trying to get a basic ChooseFromList working on a UDO. The UDO is created graphically with an SRF file. The new EditText that I added to the form is not bound to anything. I've searched and found lots of (similar) examples on these forums, but for some reason I cannot get the ChooseFromList "magnifying glass" to appear at ALL inside of my EditText. Below is the method that I'm calling on FormLoad to create the CFL and add it to the form. I've also tried performing much of this in the UI instead and altering the SRF file itself, but it seemed to make no difference. What am I doing wrong?
Private Sub addNewCFLs() Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams = Nothing Dim oTxt As SAPbouiCOM.EditText = Nothing Try
oTxt = Me.m_oForm.Items.Item("txtTest").Specific
'Add data source Me.m_oForm.DataSources.DBDataSources.Add("OITM")
'Setup the creation parameters for the CFL oCFLCreationParams = Me.m_oAppCls.SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams) oCFLCreationParams.MultiSelection = False oCFLCreationParams.ObjectType = "4" 'Items table oCFLCreationParams.UniqueID = "cflItem" Me.m_oForm.ChooseFromLists.Add(oCFLCreationParams)
'Now, bind it to the EditText object oTxt.DataBind.SetBound(True, "OITM", "ItemCode") oTxt.ChooseFromListUID = "cflItem" oTxt.ChooseFromListAlias = "ItemCode"
Catch ex As Exception AsapSharedClasses.ErrorLog.AddEntryWithTrace(ex) Finally NewSharedMethods.releaseCOMobject(oCFLCreationParams) NewSharedMethods.releaseCOMobject(oTxt) End Try End Sub
I get no error messages, no indication that anything is wrong, but the CFL just never seems to appear as an option.
I should also note that on this form we also have some User Defined Values set for other fields that are pointing to previously constructed queries, and those ChooseFromLists that result from the UDV are working fine (I don't quite understand the relationship between UDVs and CFLs, but there appears to be one?). Here is an example of one of the CFLs that were created automatically by the UDV:
And here is the new "test" EditText that doesn't appear to show a CFL with the above code in place:
Should just adding the CFL to the form's CFL Collection, along with binding the table and setting the CFL info on the EditText cause it to be added to this form visibly, or is there another step that I'm missing?
Any assistance would be appreciated.