Skip to Content
avatar image
Former Member

Selecting a value in a combobox within an matrix in a system dialog

I'm a novice UI API developer, developing my first add-on.

I'm using system form 146 (payment means, inside incoming payments).

The matrix is item UID 112.

I'm trying to select the credit card type from code within my add-on.

I couldn't find an example in the SDK how to achieve this.

Again, this is a system form, and it's bound to a system data table (OCRC).

I know the value I want to select, however I can't figure out how to do the selection from code.

Thanks,

Dan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Nov 02, 2015 at 01:28 PM

    Hi Dan,

    Try something like this:

                Matrix mtx = (Matrix)Form.Items.Item("112").Specific;
                ((ComboBox)mtx.Columns.Item("Your collumn ID").Cells.Item("Your row index").Specific).Select("your value", BoSearchKey.psk_ByValue);
    
    

    Regards,

    Diego

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 02, 2015 at 03:11 PM

    Thank you all,

    By the time my post was published, I already found the solution.

    It's still great to be part of such a helpful community.

    This is my final code in case someone will need something similar in the future:

    SAPbouiCOM.Item oItem = oform.Items.Item("112");

    SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)oItem.Specific;

    SAPbouiCOM.Columns oColumns = oMatrix.Columns;

    SAPbouiCOM.Column oColumn = oColumns.Item("41");

    SAPbouiCOM.Cell oCell = oColumn.Cells.Item(1);

    SAPbouiCOM.ComboBox oComboBox = ((SAPbouiCOM.ComboBox)(oCell.Specific));

    oComboBox.Select(sCardName, SAPbouiCOM.BoSearchKey.psk_ByDescription);


    Dan

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 02, 2015 at 01:35 PM

    hi, first get the item from the form, then cast combobox item and

    sapbouicom.item item = form.items.item("UID");
    (((SAPbouiCOM.ComboBox)item.Specific).Select("<KEYVALUE>", SAPbouiCOM.BoSearchKey.psk_ByValue);

    check the documentation, under combobox object , select method.

    happy coding

    Add comment
    10|10000 characters needed characters exceeded