Skip to Content
0

How to set if condition based on combobox value in SAP B1 SDK?

May 02 at 01:35 PM

51

avatar image

Hi all,

I write codes of to hide field (UDF) on Activity form in SAP B1, but I want to set condition based on value of Activity field, for example When I select in combobox Task then that UDF shows if I select Phone Call then UDF hides.

The following is my code

Dim oform As SAPbouiCOM.Form = SBO_Application.Forms.Item(FormUID) 

oform.Items.Item("U_ModTrav").Visible = False
oform.Items.Item("1000001").Visible = False

How can I set this condition in SAP B1 SDK?

Please anyone can help me

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

1 Answer

Best Answer
ANKIT CHAUHAN
May 02 at 01:50 PM
0

Hi Rurangwa Schadrack,

1. Use the Event et_COMBO_SELECT for 'Activity' ComboBox on Activity Form.

2. Get the value which is selected by the User.

3. Enable/Disable the fields as per the value selected in the ComboBox.

This can be done something like this: (Please make the necessary amendments as per your needs.)

case BoEventTypes.et_COMBO_SELECT:
{
    if (pVal.ItemUID == "67" && pVal.FormType == 651)
    {
        SAPbouiCOM.ComboBox oComboActivity = (SAPbouiCOM.ComboBox)this.m_SBO_Form.Items.Item("67").Specific;
        string SelectedValue = oComboActivity.Selected.Value.Trim();


        if (SelectedValue == "Task")
        {
            //Do your process.
        }


        else if (SelectedValue == "Phone")
        {
            //Do your process.
        }
    }


}break;

Hope it helps!

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thank you so much ANKIT

0
0