Skip to Content
0
Former Member
Jun 09, 2008 at 01:41 PM

Problem with SAPbobsCOM.Company

41 Views

Hello.

I am Using the SAPbobsCOM.Company for to load combobox and add value to userfields but does not working.

This is my code:

Dim RS As SAPbobsCOM.Recordset

oitem = oForm.Items.Item("ECate")

oCombo = oitem.Specific

'alone arrives to this code and stop the addon

RS = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

RS.DoQuery("SELECT CardCode,CardName FROM OCRD WHERE CardType='C' ORDER BY CardCode")

RS.MoveFirst()

While RS.EoF = False

oCombo.ValidValues.Add(RS.Fields.Item("CardCode").Value, RS.Fields.Item("CardName").Value)

RS.MoveNext()

End While

Regars,

Jose