cancel
Showing results for 
Search instead for 
Did you mean: 

Edit and text and choose from list

Former Member
0 Kudos

hello,

I am trying to create a form that resemle to the purchase order form.

In the purchase order form when we select the card code from the choose from list

the system fill all the fileds like the name docnum .. with relevant information.

i tried to do that by using the vent et_evaluate of the edit text bind with the Card code in my form.

The problem is that when i clik on the choose from list button the event is lanched and then the value of the card code is "" so i can't crate my queries to get the infomation like suplier name and ..

does any body have an answer?

This my code:

switch (pVal.ItemUID)

{

case "3":

{

_Form.Freeze(true);

try

{

string NumFournisseur =

((EditText) _Form.Items.Item("3").Specific).Value;

ArrayList DFournisseur =

new DB.PurchaseRequest(_SboCompany).

GetDetailsFournisseur(NumFournisseur);

EditText Textvar;

// remplir nom fournisseur et nom contact

Textvar = (EditText) _Form.Items.Item("2").Specific;

Textvar.String = DFournisseur[0].ToString();

Textvar = (EditText) _Form.Items.Item("4").Specific;

Textvar.String = DFournisseur[1].ToString();

// remplir les dates comptable , de livraiosn et du document

Textvar = (EditText) _Form.Items.Item("17").Specific;

Textvar.String = DateTime.Today.ToString();

Textvar = (EditText) _Form.Items.Item("19").Specific;

Textvar.String = DateTime.Today.ToString();

Textvar = (EditText) _Form.Items.Item("21").Specific;

Textvar.String = DateTime.Today.ToString();

// remplir devise partenaire et numéro document

((EditText) _Form.Items.Item("59").Specific).String =

new DB.PurchaseRequest(_SboCompany).GetCurrencyCode(

NumFournisseur);

_Form.Items.Item("59").Visible = true;

_Form.Items.Item("59").Enabled = false;

((ComboBox) _Form.Items.Item("10").Specific).Select(

"primary",

BoSearchKey.

psk_Index);

((EditText) _Form.Items.Item("11").Specific).String =

new DB.PurchaseRequest(_SboCompany).GetLastDocNum().

ToString();

((EditText) _Form.Items.Item("12").Specific).String = "0";

}

catch (Exception e)

{

Console.WriteLine(e.Message);

}

_Form.Freeze(false);

break;

}

}

break;

}

catch (Exception ex)

{

Console.Write(ex.Message);

}

}

}

break;

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey Achref,

You can use the event and code like this:

string vendCode = string.Empty;
SAPbouiCOM.IChooseFromListEvent oCFLEvento = (SAPbouiCOM.IChooseFromListEvent) pVal;
string sCFL_ID = oCFLEvento.ChooseFromListUID;
SAPbouiCOM.ChooseFromList oCFL = oVendorSourcingForm.ChooseFromLists.Item(sCFL_ID);
SAPbouiCOM.DataTable oDataTable =  oCFLEvento.SelectedObjects;

if (oDataTable != null)
{
	//get selected value from datatable
	if (oDataTable.Rows.Count > 0)vendCode = oDataTable.GetValue(0, 0).ToString();

Also check out 17.ChooseFromList in the samples that you can download.

Hope that helps

Curtis

Answers (0)