Matrix Rows.Count value not correct when deleting rows in matrix
i have an issue with the rows.count value of a matrix. In a optimizer rule I catch the update Event to check some values in the production matrix table before the changes get applied.
This code works if only one line in the table of production order is deleted.
// get WOR1 table of production order
mWOR1 = Matrix.GetFromUID(pVal.Form, "37"); // WOR1 table
// loop through matrix
for(i = 0; i < mWOR1.Rows.Count - 1; i++)
ItemCode = mWOR1.GetValue("4", i);
But if I delete 2 lines at once first and press then the Update SAP form Button, then the code crashes with "matrix invalid row number". Rows.Count does not recognize deleted rows!
I thought that this value is the current value with every execution of the rule. Does anybody knows a solution or workaround for this?
Thank you in advance, Sebastian