Skip to Content
0

Getting the Event type for CFL and Combobox selection/text changed

Nov 18, 2016 at 12:09 PM

44

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
DIEGO LOTHER Nov 18, 2016 at 12:20 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Kamau Kinyanjui Nov 18, 2016 at 12:43 PM
0

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.


Share
10 |10000 characters needed characters left characters exceeded