StrataFrame Forum

Access To Deleted Rows in Business Object

http://forum.strataframe.net/Topic11808.aspx

By Tim Dol - 10/2/2007

Do you keep a list of deleted rows within the business object?  I found I can check the row state in CurrentDataTable.Rows but I can't locate the data.

Thanks,
Tim

By Trent L. Taylor - 10/2/2007

They are in there unless you have cleared the BO.  By default they are filtered out and not displayed.  You can cycle through the CurrentDataTable or set the ShowDeletedRows on the BO property to True.
By Tim Dol - 10/3/2007

In my example I deleted two rows. I can see the CurrentDataTable row count value, which is correct, but I can't get at the data. I get an error accessing the row item 'Deleted Row Information Cannot be accessed through the row'.

Here is a sample of my code. Am I accessing the row item information correctly?

Thanks

Tim

Dim loRow As DataRow

'-- Cycle through the DataTable Rows

For Each loRow In Me.CurrentDataTable.Rows

If loRow.RowState = DataRowState.Added Or loRow.RowState = DataRowState.Deleted Then

dn.FillByPrimaryKey(loRow.Item("wpt_DepartmentCode"), loRow.Item("wpt_CategoryCode"))

If dn.Count > 0 Then

By StrataFrame Team - 10/3/2007

You can access the data by either using the CurrentRow.Item("FieldName", rowVersion) and pass Original as the row version or you can go to the BOMapper and for each field on the business object you want to access, customize it and check the Allow Deleted Rows option, which will test on the row state and return the original value if the row is deleted.