Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 18, 2016 at 12:20 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 18, 2016 at 12:43 PM

    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.


    Add comment
    10|10000 characters needed characters exceeded