Access To Deleted Rows in Business Object


Author
Message
Tim Dol
Tim Dol
StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
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

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.
Tim Dol
Tim Dol
StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)StrataFrame User (446 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
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


StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
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.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search