/scripts/ahub.form.attachments.js
0

How to get ComboBox selected value text from SAP B1 form

Jun 23, 2017 at 01:17 PM

837

avatar image
Former Member

How do I get a combobox selected value ?

In the attached screen shot , Payment Terms drop down list i have chosen "30 Days EOM" value .

Using c# code, how can get ComboBox(dropdown) selected value.

This is my sample code for getting text box values, same way how to get drop down selected text.

Thanks.

SAPbouiCOM.EditText oEdit = null;
 SAPbouiCOM.Item oItem = null;
oItem = oForm.Items.Item("234000013");
                oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
                primaryPartyCode = (oEdit.String);

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
DIEGO LOTHER Jun 23, 2017 at 01:22 PM
0

Hi Werner,

Use something like this:

SAPbouiCOM.ComboBox cbx = (SAPbouiCOM.ComboBox)oForm.Items.Item("your id").Specific;
if (cbx.Selected != null)
{
    string descrition = cbx.Selected.Description;
    string value = cbx.Selected.Value;
}

Hope it helps.

Kind Regards,

Diego Lother

Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Diego,

Your mention code working very fine.

Thank you your prompt replay Diego Lother.

1
Former Member

Hi Diego,

Can you please provide me same as Check box, Radio button selected values related code.

I mean (Active,Inactive) or (Paid ,Unpaid) Radio button,Check box .

same as if check box items.

thanks.

0

Hi Werner,

For check box:

SAPbouiCOM.CheckBox chk = (SAPbouiCOM.CheckBox)oForm.Items.Item("your item id").Specific
bool isChecked = chk.Checked;

For option button:

SAPbouiCOM.OptionBtn optb = (SAPbouiCOM.OptionBtn)oForm.Items.Item("your item id").Specific
bool selected = optb.Selected;

Hope it helps.

Kind Regards,

Diego Lother

0
Former Member
DIEGO LOTHER

Hello Diego Lother,

Above sample code working very fine.

Thank you your prompt replay Diego Lother.

Thanks,

0
Former Member

Dears Dlego Lother.

I added a UDF COMBOX control in the standard SO LINE MATRIX UI. I want to assign value to UDF COMBOX control, but the COMBOX of VALUE in SDK is read-only. What should I do? thanks.

0
Skip to Content