Greetings all, I'm writing an addon for SAP B1 9.1 and I'm quite stuck as I don't seem to be able to get FormEvents to work. I need to do something every time the Activity form (FormType 651) is opened, and this code currently does nothing at all neither when I open Activity nor when I try loading records (which should trigger BoEventTypes.et_FORM_DATA_LOAD, but that won't work either). Did I miss something?
public class Form__651 : B1Form
FormType = "651";
public virtual void OnAfterFormLoad(BusinessObjectInfo pVal)
bool ActionSuccess = pVal.ActionSuccess;
Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
//form.Items.Item("51").Visible = false;
The main is like this:
public static void Main()
if (!Connection.Connect()) return;
PROJECTNAME_Db addOnDb = new PROJECTNAME_Db();
PROJECTNAME_Cockpits addOnCockpit = new PROJECTNAME_Cockpits();
catch (System.Runtime.InteropServices.COMException com_err)
System.Windows.Forms.MessageBox.Show("ERROR - Connection failed: " + com_err.Message);
By the way, the whole addon loads alright and rightly keeps running until I stop the debugger. Thanks in advance!