Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Event et_FORM_LOAD can not be catched by B1DE code.

I do some code on load a FORM from srf file and get trouble in catch the event for et_FORM_LOAD.

pls help to check my code and figure out my root cause:

(1) srf file

<Application>
  <forms>
    <action type="add">
      <form appformnumber="-1"  
           FormType="-1" type="4" BorderStyle="4" 
           uid="Z_PUR_PoExportForm"

(2) code for menu

    class PoExportMenus : B1XmlFormMenu
    {
        private static readonly string FORM_XML_FILE = "PoExportForm.srf";
        private static readonly string MENU_UID = "Z_PUR_PoExportMenu";

        public PoExportMenus() : base()
        {
            MenuUID = MENU_UID;
            LoadXml(FORM_XML_FILE);
        }

        [B1Listener(BoEventTypes.et_MENU_CLICK, false)]
        public virtual void OnAfterMenuClick(MenuEvent pVal)
        {
            LoadForm();
        }
    }

(3) AddOn Form event process

    class PoExportForm : B1Form
    {
        public PoExportForm() : base()
        {
            this.FormType = "Z_PUR_PoExportForm";
        }

        [B1Listener(BoEventTypes.et_FORM_LOAD, true)]
        public virtual bool OnBeforFormLoad(ItemEvent pVal) 
        {
            SAPbouiCOM.Form oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...
            System.Windows.Forms.MessageBox.Show("OK");
            return true;
        }
    }

when I debug my AddOn code, I can not see a window popup the OK message.

Former Member
Not what you were looking for? View more on this topic or Ask a question