cancel
Showing results for 
Search instead for 
Did you mean: 

Event et_FORM_LOAD can not be catched by B1DE code.

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Should I put the processing code by B1Event instead of B1Form?