on 11-18-2016 12:09 PM
Hi,
I have the following under item events:
public void HandleItemEvent(ref SAPbouiCOM.ItemEvent pVal)
{
#region Schedule Number
if ((pVal.EventType == SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST) && (pVal.ItemUID == "CardName") && pVal.Before_Action == false)
{
// Change the Schedule Number
_form.Freeze(true);
AddRefNo();
_form.Freeze(false);
}
if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_VALIDATE && pVal.ItemUID == "LeaseType" && pVal.Before_Action == false && pVal.InnerEvent == false)
{
// Change the Schedule Number
_form.Freeze(true);
AddRefNo();
_form.Freeze(false);
}
#endregion
}
There is a CFL named "CardName" and a combobox named "LeaseType".
I would like to know what events to capture such that the AddRedNo() method is executed whenever there is a selection in either of the 2 form items.
AddRedNo() should run as soon as a user makes a CLF selection or there is a selection change in the combobox.
How do I achieve this? Any help appreciated.
Hi Kamau,
For the first if , you can do the following:
if ((pVal.EventType == SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST) && (pVal.ItemUID == "the id of the item where your CFL is related") && pVal.Before_Action == false)
{
// Change the Schedule Number
_form.Freeze(true);
AddRefNo();
_form.Freeze(false);
}
OR
if ((pVal.EventType == SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST) && pVal.Before_Action == false)
{
IChooseFromListEvent oCFLEvt = (IChooseFromListEvent)(pVal);
if (oCFLEvt.ChooseFromListUID == "CardName")
{
// Change the Schedule Number
_form.Freeze(true);
AddRefNo();
_form.Freeze(false);
}
}
For the second if, you can use:
if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_COMBO_SELECT && pVal.ItemUID == "LeaseType" && pVal.Before_Action == false)
{
// Change the Schedule Number
_form.Freeze(true);
AddRefNo();
_form.Freeze(false);
}
Hope it helps.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Diego for your quick reply.
The combbox and CFL now works fine. I was trying to capture the CFL entry directly from the editbox item and not from the user datasource.
Regards,
Kinyanjui.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.