Skip to Content

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

Updating Matrix On a System Form

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() );

            }

        }

Tags:
Former Member
replied

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

0 View this answer in context

Helpful Answer

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