on 11-14-2007 2:06 PM
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;
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.