cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member185682
Active Contributor
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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.