Skip to Content
0
Former Member
Dec 21, 2007 at 03:01 PM

Delete row matrix in UDO Form

636 Views

Hi All,

I've created a simple form based on an registered UDO (2 tables: Document and Document Lines).

This form contains a matrix bounded to the lines of my UDO document.

Everything works fine except the Delete button that should delete a document line in the matrix: it never

deletes the lines from database, although it deletes them from the form. But if I select again the same

record, the deleted line is show again!

My code is very simple:

void btRemove_ClickEvent()

{

// Remove selected row from Matrix

SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix) oForm.Items.Item("mxMatrix").Specific;

int iPos = oMatrix.GetNextSelectedRow( 0, SAPbouiCOM.BoOrderType.ot_RowOrder );

if( iPos > -1 )

{

oMatrix.DeleteRow( iPos );

oMatrix.FlushToDataSource();

oForm.Update();

}

}

What is the problem with my code? Is it missing something?

Regards,

Manuel Dias