Erik van Dongen

When an item is added to the matrix on the order form (139), i want to validate if the item can be added. To do this, i catch the validate event before the sap action.
Matrix matrix = Matrix.GetFromUID(e.Form, "38");
MatrixColumn itemCodeColumn = matrix.Columns["1"];
itemCodeColumn.AddHandler_Validate(ModeComponent.FormModes.ALL, validateItemCode);

In this validation i want to be able to cancel the action, which means that the row is not filled at all. Something like Valid = false;

I can't find anything like this. I can only set
private void validateItemCode(Validate e)
e.ExecuteSAPAction = false;

If i do this, the itemcode is still there and the rest of the line is filled corresponding the item master data.

Is there a way to do is or do i have to delete the row by code or something?

All suggestions are welcome.

Marco Schweighauser

If think you would have to delete the line because it is not possible to write an empty string back to the ItemCode column. Because of the choose from list it is not possible to handle this correctly by using the Validate event.

Perhaps you could catch the ChooseFromListEvent (see SwissAddonFramework.Global.Choose...) to act before something is inserted.



Please sign in to leave a comment.

Didn't find what you were looking for?

New post