cancel
Showing results for 
Search instead for 
Did you mean: 

"cannot insert null into column.." ErrorWhen I delete Last row in a Matrix

Former Member
0 Kudos

I have created a form where I show the document's data in the header form and a matrix for showing document lines data.

I can insert records and update records from this form for header as well as matrix tables.

My problem is in deleting records from the matrix. For deleting the row from the matrix, on "Delete" item pressed event I call oMatrix.DeleteRow function for the selected row. This function deletes the row from the matrix. It also deletes the record from the document lines table if the number of rows are more than one. But in case of only one row in the matrix, on deleting the row, I get an exception saying "Cannot Insert null in the DocEntry field".

Edited by: vishypat on Aug 16, 2009 10:26 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thx for the solution.

Former Member
0 Kudos

Hi Vishypat,

Its a default functinoality for matrix in SAP B1, to have one blank row at any point of time, for adding fresh records. So in your scenario, if there is going to be only one active row and if you are try to delete it, in the UI level for matrix, have a blank row there, while clear the values in the table in the back end.

Hope this solves your problem.

Regards,

Satish. B.