Skip to Content
author's profile photo Former Member
Former Member

some info about button combo..

Hi.. i am creating one button combo on the sales opprotunites ..

i had this below code

i am able to create it

but i am not pulling the valid values into the combo box may i know how can i add valid values..

oexitem = oOrderForm.Items.Item("1")

Dim oitem As SAPbouiCOM.Item

oitem = oOrderForm.Items.Add("800", SAPbouiCOM.BoFormItemTypes.it_BUTTON_COMBO)

oitem.Top = oexitem.Top

oitem.Height = oexitem.Height

oitem.Width = oexitem.Width

oitem.Left = oexitem.Left + 300

obcm = oitem.Specific

obcm.ValidValues.Add("Copy to ", "Copy to")

obcm.ValidValues.Add("Copy from", "Copy from")

obcm.ValidValues.Add("Copy", "Copy")

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Aug 29, 2012 at 12:05 PM


    I have used this method for adding Valid Values. Your code looks fine too. You can get some idea from here. Just do one thing in your code, declare a Button combo object. I think that should work for you. Try this:

    oCombo = (SAPbouiCOM.ButtonCombo)this.m_SBO_Form.Items.Item("Id for your button Combo").Specific;

    It is the Method for adding Valid values:

    private void FillValidValues()


    SAPbobsCOM.Recordset oRecSet = default(SAPbobsCOM.Recordset);

    SAPbouiCOM.ButtonCombo oCombo = default(SAPbouiCOM.ButtonCombo);



    oCombo = (SAPbouiCOM.ButtonCombo)this.m_SBO_Form.Items.Item(enControlName.btnCombo).Specific;

    oRecSet = (Recordset)this.SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);

    oRecSet.DoQuery("SELECT Name FROM [@TEMPT] order by code Asc");

    if (oCombo.ValidValues.Count > 0)


    for (int i = 0; i <= oCombo.ValidValues.Count; i++)


    oCombo.ValidValues.Remove(i, SAPbouiCOM.BoSearchKey.psk_Index);



    oCombo.ValidValues.Add("", "");

    if (oRecSet.RecordCount > 0)


    while (oRecSet.EoF == false)


    oCombo.ValidValues.Add(oRecSet.Fields.Item(0).Value.ToString().Trim(), "");





    catch (Exception ex)


    this.SBO_Application.SetStatusBarMessage(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, true);



    Hope it helps


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Ankit Chauhan

      Yes..Yes.. Your currect...

      values are my copy button ..

      after loading the form

      in headerlevel cardcode is there..

      i was not selected that one before pressing on the copy button ..

      so , i realized and tested and then slected the cardcode..

      and then the copy button is worked...

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.