Saving a BO row by row?


Author
Message
Michel Levy
Michel Levy
StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Due to complex checking on insert on server side (nested trees n:n checked by many CTE), I need to save a specific BO row by row, in a serialized transaction:
Save first row, and movenext only if result is Success... I need to Rollback on the first failure.

I know I can create a copy of that BO, then clear my BO, filter the copy on each row and copy currentview in original BO, and save each row (also another solution with snapshot), but is there another way, let say more simple, or more elegant?

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
Well, this is obviously not normal, but you could go at it several different ways.  Like you mentioned, or you could fill the BO one at a time or create a Save BO to which you enumerate the filled BO and then copy in the data to the Save BO one at a time (or vice versa).  But if you have this need it is going to take a little effort as this is generally not how saves are performed...and in fact out of all of these years this is the first time I have ever heard the need for this.  But yeah, you will need to take one of these approaches.
Michel Levy
Michel Levy
StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Hi Trent,

I know it's definitely not normal, but I have this need (trees where any child may have many parents, on whatever level they are - first written in VFP6, a few years ago BigGrin).

End-user may fill that BO with several rows in UI, but these may be saved only one at a time on server (the first checking of the trigger is to count the rows on inserted, and raises an error if >1).

So, let me play with snapshot Tongue

Thanks for your answer

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