on 12-25-2014 3:23 PM
Hello Everyone,
I am trying to update a matrix that exist in a SAP Business One system form. I open the form in SAP Business One Studio and than create project in Visual Studio 2010 to work on the system form. I followed the methods I saw in the forums but I get an error at the beginning. The error is "system nullreferenceexception object reference not set to an instance of an object" (first line of the try block). Also if I remove the exception handler, I get the error "Addon 90000002 failed with exception; Event type 6" in SAP B1. This is the first time I work on a system form therefore I assume that I am missing some technical requirements in the code or project settings. Also If I remove the first 2 lines of the try block code works fine.
Could you please help me with this issue
private void Button0_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
{
BubbleEvent = true;
try
{
SAPbouiCOM.Form oForm = SBO_Application.Forms.Item(pVal.FormUID);
SAPbouiCOM.Matrix oMatrix = oForm.Items.Item("35").Specific as SAPbouiCOM.Matrix;
Application.SBO_Application.MessageBox("Hello o World");
}
catch (Exception e) {
Application.SBO_Application.MessageBox(e.ToString() );
}
}
Hi Atilla,
Can you try
SAPbouiCOM.Form oForm = Application.SBO_Application.Forms.Item(pVal.FormUID);
SAPbouiCOM.Matrix oMatrix = oForm.Items.Item("35").Specific as SAPbouiCOM.Matrix;
Application.SBO_Application.MessageBox("Hello o World");
Regards
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Atilla,
Your problem is you have declared SBO_Application twice.
1. Once in your Application Class, which is the one you had initialized with the connection,
2. The other one is in this EventHandling class. You do not need this one since it is not initialized.
You have to always refer the SBO_Application declared in your Application class.
Regards
Edy
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.