Skip to Content
0

combobox to textbox c# sapb1

Nov 14, 2017 at 10:48 AM

79

avatar image
Former Member

I woud like to when i selected a value in combobox allow m populate certain text boxes such as, textBox1, textBox2 , how can i do that? it's an addon.

I'm creating an addon, and this time im working with form similar to bp, and payment run, So can get the information on my combo boxes, bur for example in sucursal its the defualt value, i would like to get the value from the combobox "cuenta" in the same time fill bic/swift code textbox and control no.... that's all

combobox.png (32.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
ANKIT CHAUHAN
Nov 14, 2017 at 11:07 AM
0

Hi,

Can we have some screenshots about the issue?

Kind regards,

ANKIT CHAUHAN

SAP SME Support

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

Sorry, I'm creating an addon, and this time im working with form similar to bp, and payment run, So can get the information on my combo boxes, bur for example in sucursal its the defualt value, i would like to get the value from the combobox "cuenta" in the same time fill bic/swift code textbox and control no.... that's all

combobox.png (32.9 kB)
0

Hi,

It can be done something like this:

SAPbouiCOM.Form oForm = (SAPbouiCOM.Form)SBO_Application.Forms.GetForm(BusinessObjectInfo.FormTypeEx, 1);
SAPbouiCOM.ComboBox oComboApproval = (SAPbouiCOM.ComboBox)oForm.Items.Item("23").Specific;
if (oComboApproval.Value.Trim() == "Approved")
{
	SAPbouiCOM.EditText oEditStatus = (SAPbouiCOM.EditText)oForm.Items.Item("46").Specific;
	oEditStatus.Value = "Test";
}

Kind regards,

ANKIT CHAUHAN

SAP SME Support

1
Former Member
ANKIT CHAUHAN

if the value with a query for example, how can i get the changed?

 string SqlCad5 = "select distinct DSC1.BRANCH  from DSC1  inner join ODSC ON DSC1.BankCode=DSC1.BankCode  where='" + ComboBox3.Value.ToString() + "'";
//oEditStatus.Value = SqlCad5;
0

Hi,

Try this:

SAPbobsCOM.Recordset oRecSet = (SAPbobsCOM.Recordset)SBO_Company.GetBusinessObject(BoObjectTypes.BoRecordset);
oRecSet.DoQuery(Query);
string ValueToExtractFromQueryResult = oRecSet.Fields.Item("BRANCH").Value.ToString();

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0
Former Member
ANKIT CHAUHAN

error.pngit gave me an error on the doquery :/

    SAPbobsCOM.Recordset oRecordset = ((SAPbobsCOM.Recordset) (oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
            SAPbouiCOM.ComboBox oComboApproval = (SAPbouiCOM.ComboBox)oForm.Items.Item("cmbctbc").Specific;
            if (oComboApproval.Value.Trim() != "")
            {




              
                string SqlCad5 = "select distinct DSC1.BRANCH , DSC1.Account from DSC1  inner join ODSC ON DSC1.BankCode=DSC1.BankCode  where='" + ComboBox3.Value.ToString() + "'";
                oRecordset.DoQuery(SqlCad5);
                string ValueToExtractFromQueryResult = oRecordset.Fields.Item("BRANCH").Value.ToString();


            }
        }

error.png (44.4 kB)
0

Hi,

Error message shows there is an exception while executing your query. Please check your query.

There is nothing after "Where" clause which is the problem.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0
Former Member
ANKIT CHAUHAN

yeah, maybe it's because i get the value in the comebobox

 "select distinct DSC1.BRANCH as sucursal , DSC1.Account as cuenta from DSC1  inner join ODSC ON DSC1.BankCode=ODSC.BankCode  where DSC1.BankCode='" + ComboBox3.Value.ToString() + "'"<br>
0

Hi,

Check the "Where" clause in the query which is the problem for you.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

1
Former Member
ANKIT CHAUHAN

THANK YOU! sorry did`t see my mistake, thank you so much ANKIT CHAUHAN

0