Skip to Content
-1

SAP Crushes in sales order

Aug 01, 2017 at 02:17 PM

53

avatar image
Former Member

Hello experts,

I have a very simple and annoying problem , I created a form with a Matrix filled with ItemNames when the user double click a row it copy the ItemName to the matrix of the sales order , here SAP crushes It doesn't happen every time but occasionnaly and the users are always complaining about it .

here is the code it's very basic

try {

if (pVal.Row <= 0) return;

String ItemName = ((SAPbouiCOM.EditText)Matrix2.GetCellSpecific("Col_0", pVal.Row)).Value;

oMainForm = Application.SBO_Application.Forms.Item(MainFormUID);

Matrix = (SAPbouiCOM.Matrix)oMainForm.Items.Item("38").Specific;

SAPbouiCOM.EditText ed = (SAPbouiCOM.EditText)Matrix.GetCellSpecific("3", this.Row);

ed.Value = ItemName;

oForm.Close();

} catch (Exception Ex)

{

Application.SBO_Application.MessageBox(Ex.Message);

}

Please help

Best regards

10 |10000 characters needed characters left characters exceeded

Could you also post the event handler part?

0
Former Member

Thank you Danilo Kasparian for your answer , the event is DoubleClick After the code is

this.Matrix2.DoubleClickAfter += new SAPbouiCOM._IMatrixEvents_DoubleClickAfterEventHandler(this.Matrix2_DoubleClickAfter);

private void Matrix2_DoubleClickAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)

{

try

{ if (pVal.Row <= 0) return;

String ItemName = ((SAPbouiCOM.EditText)Matrix2.GetCellSpecific("Col_0", pVal.Row)).Value;

oMainForm = Application.SBO_Application.Forms.Item(MainFormUID);

Matrix = (SAPbouiCOM.Matrix)oMainForm.Items.Item("38").Specific;

SAPbouiCOM.EditText ed = (SAPbouiCOM.EditText)Matrix.GetCellSpecific("3", this.Row);

ed.Value = ItemName;

oForm.Close();

} catch (Exception Ex) { Application.SBO_Application.MessageBox(Ex.Message);

}

}

Thanks in advance

Best regards

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Danilo Kasparian Aug 02, 2017 at 12:40 PM
0

Do you know where exactly is crashing?

Just guessing, try to use the previous way of event handler

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you for the answer , it crashes right after double click when i put the value in the ItemName

what you mean by previous way of event handler?

Can you please give me an example ?

Best Regards

0

You can find examples in your SDK path

C:\Program Files (x86)\SAP\SAP Business One SDK\Samples\COM UI\CSharp\02.CatchingEvents

0
Former Member

yes I tried this but i still have the same problem

I think the error is unhandled exception in B1Engine.dll

Best regards

0