Mechanism to update a single row in a BO?


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I find myself occasionally needing to update a single record within a BO, usually after messing with data via a sproc. Is there any way to update just one record (row) in the BO?
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
Well, if it's the only DataRow in the BO that is not Unchanged (modified), then it will be the only row that is saved.  Otherwise, you would need to create a new business object, filter the current one down to that record, use MergeDataFrom to copy over the record, and save the new business object with just that one record in it.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Oops, you misunderstand. How do I refresh that single data row with data from the database?
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
Aha, that makes more sense Smile  You can use the AppendDataTable method and pass the query that will only retrieve that one record (we don't have an AppendByPrimaryKey).  The other argument for the AppendDataTable() method, besides the DbCommand, is an enum that specifies whether to overwite duplicate records or keep duplicate records; you want to overwrite the record.
Robin J Giltner
Robin J Giltner
StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)
Group: Forum Members
Posts: 105, Visits: 650
Does the AppendDataTable fire the CurrentDataTableRefilled Event ?

Thanks,

Robin Giltner

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
Yes.  When tables are merged it goes through the ChangeCurrentDataTable method which ultimately raises the CurrentDataTableRefilled event.
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