cancel
Showing results for 
Search instead for 
Did you mean: 

[HELP]SDK UI ComboBox

Former Member
0 Kudos

I want to bind my ComboBox from query. How can I do that? Please help.

When the form is load, the ComboBox will fill from my database. Like BPName.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member689126
Active Contributor
0 Kudos

Hi

Try this

Dim rsResult As SAPbobsCOM.Recordset = Nothing
            Dim sValue, sDescription As String
            rsResult = B1Connections.diCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
            While _comboBox.ValidValues.Count > 0
                _comboBox.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)
            End While
            rsResult.DoQuery("Select Code,Name from OUBR")
            rsResult.MoveFirst()
            While Not rsResult.EoF
                sValue = rsResult.Fields.Item(0).Value.ToString()
                sDescription = rsResult.Fields.Item(1).Value.ToString()
                _comboBox.ValidValues.Add(sValue, sDescription)
                rsResult.MoveNext()
            End While

Regards

Arun

Former Member
0 Kudos

Thanks for the swift response. I'm gonna try this.

Can I ask about this command.

rsResult = *B1Connections*.diCompany.GetBusinessObject(*BoObjectTypes*.BoRecordset)

_comboBox

Are undefined and

Edited by: hikaru1207 on Dec 9, 2011 5:54 AM

former_member689126
Active Contributor
0 Kudos

Hi

i am using B1DE for development that why B1Connections change it like this

rsResult =oCompany.GetBusinessObject(*BoObjectTypes*.BoRecordset)

Dim _combobox as SAPbouiCOM.ComboBox =form.items.item("cmbuid").Specific

Hope this helps

Regards

Arun

Answers (0)