Add a Column to a system matrix
Erik van DongenIn the order form, we want to show the available stock of the SELECTED warehouse. SAP is only showing the available stock of all the warehouses together.
The calculation of the stock is no problem. The thing is that I don't want to create a UDF for the showing of the value, because there's no need to save the data in the database and this field will show up in all the other document forms which we don't want.
To create the column, i added the following code in the formload:
Matrix matrix = Matrix.GetFromUID(e.Form, "38");
// Column ItemCode
// Column WhsCode
matrix.Columns["24"].AddHandler_Validate(ModeComponent.FormModes.ALL, null, validateWarehouse);
// Remove rows to add column
// Add a user datasource
// Create and add the column
MatrixColumn whsQty = MatrixColumn.CreateNew("U_WhsQty");
whsQty.DataBind = DataBind.CreateNew("udWhsQty");
whsQty.DataBind.DataBound = true;
whsQty.Type = MatrixColumn.MatrixItemType.TextEdit;
whsQty.DisplayDesc = true;
whsQty.Description = "WhsQty";
// Add a row again
The problem is that at the end of the onload function. The databind is correct but as soon as the validate itemcode or warehousecode is triggerd, the databind is gone and no columnheader is showing up.....
All help on this problem is appreciated.
Erik van Dongen
Marco SchweighauserHello Erik,
I don't think it is possible to add a column to a system matrix in a stable way. The best thing would be to use a UDF with the drawback of unused saved data.