cancel
Showing results for 
Search instead for 
Did you mean: 

How to set value on textbox item ?

Former Member
0 Kudos

how to set value in text box item on choose_from_list_afteraction event

vall.SetValue("edtxt2", pVal.ItemUID, oDataTable.GetValue("edtxt2").ToString());

which r not working .

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Mohammad Asharaf,

Try this on pVal.BeforeAction == false of Choose_From_List Event on the form:

SAPbouiCOM.ChooseFromListEvent cflevent = (SAPbouiCOM.ChooseFromListEvent)pVal;

                                    SAPbouiCOM.ChooseFromList oCFLEvento = default(SAPbouiCOM.ChooseFromList);

                                    string strUid = cflevent.ChooseFromListUID;

                                    oCFLEvento = this.m_SBO_Form.ChooseFromLists.Item(strUid);

                                    SAPbouiCOM.DataTable oDataTable = cflevent.SelectedObjects;

if (pVal.ItemUID == enControlName.CustomerCode && pVal.FormMode != 0)

                                    {

                                        string Code = Convert.ToString(oDataTable.GetValue("CardCode", 0));

                                        string Name = Convert.ToString(oDataTable.GetValue("CardName", 0));

                                        string FName = Convert.ToString(oDataTable.GetValue("CardFName", 0));

                                        string Unit = Convert.ToString(oDataTable.GetValue("U_Unit", 0));                                       

                                        SAPbouiCOM.DBDataSource oDataSource;

                                        oDataSource = (DBDataSource)m_SBO_Form.DataSources.DBDataSources.Add("@SERVICE_MASTER");

                                        oDataSource.SetValue("U_CCode", 0, Code);

                                        oDataSource.SetValue("U_CName", 0, Name);

                                        oDataSource.SetValue("U_Samson", 0, FName);

                                        oDataSource.SetValue("U_UnitNo", 0, Unit);                                                                           

                                    }

Hope it is helpful.

Thanks & Regards

Ankit Chauhan

Answers (0)