Skip to Content

Add-on 9000002 failed with exception; Event Type: 6

Hi experts, can someone of you help me.

When i'm in debug mode the add-on works fine, but then if i register the addon the menu and form loads normaly but when i click on a button to fill my grid i receive the message in status bar: Add-on 9000002 failed with exception; Event Type: 6

this is the code in the button

private void Button0_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)

{

//throw new System.NotImplementedException();

cargarGrid(); //load grid

BubbleEvent = true;

}

Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 12 at 06:47 AM

    Hi,

    Can you post cargarGrid() code?

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Henning,

      Error 1: The request lookup key was not found in any active activation context

      Error 2: Object reference not set to an instance of an object

      But the error i think is in the sConnectionString, i'm using ui and di api and don't know if am i doing correctly using the SetApplication(), this is the code: (it's weird because, if i use directly the exe file in the debug folder it works but then i register the addon and run from SAP i get the error)

      public void SetApplication()
              {
                  try
                  {
                      SboGuiApi = null;
                      sConnectionString = null;
      
                      SboGuiApi = new SAPbouiCOM.SboGuiApi();
                      //sConnectionString = System.Convert.ToString(Environment.GetCommandLineArgs().GetValue(1));
                      //sConnectionString = "0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056"; 
                      //sConnectionString = Interaction.Command(); 
      
                      //if (Environment.GetCommandLineArgs().GetUpperBound(0) > 0)
                      if (System.Convert.ToString(Environment.GetCommandLineArgs().GetValue(1)) != "")
                      {
                          sConnectionString = (String)Environment.GetCommandLineArgs().GetValue(1);
                      }
                      else
                      {
                          sConnectionString = "0030002c0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056";
                      }
      
                      SboGuiApi.Connect(sConnectionString);
      
                      SBO_Application = SboGuiApi.GetApplication(-1);
                      SBO_Company = (SAPbobsCOM.Company)SBO_Application.Company.GetDICompany();
                  }
                  catch (System.Exception e)
                  {
                      System.Windows.Forms.MessageBox.Show("" + e.Message, "OK");
                  }
              }