How to Validate Rows against databse whrn not deleting immediately


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (634 reputation)Advanced StrataFrame User (634 reputation)Advanced StrataFrame User (634 reputation)Advanced StrataFrame User (634 reputation)Advanced StrataFrame User (634 reputation)Advanced StrataFrame User (634 reputation)Advanced StrataFrame User (634 reputation)Advanced StrataFrame User (634 reputation)Advanced StrataFrame User (634 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I am editing in 'Block Mode (i.e. CheckCurrentRowBeforeNavigate is set to false)  and also I have deletes set not to update the backend immediately but to delete when the Save button is pressed.

Say I have the following fields, and my Business Rules dont allow the Data to be duplicated:

Row   data
1     A
2     B
3     C


I do the following:
1. Delete Row 1
2. Change Row 3 from C to A


Now when my business rules kick in I cannot save because it says Row 3 (Now has  an A) causes a duplicate (Because Row 1 even though it has been removed from the BO. is still in the Database

Anybody got any ways round this.... I know i could get the user to Delete first, then save and then do the amendments, but was wondering if there is any paramater setting in the framework that will allow me to do the above in one 'Editing' session.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Gerard O Carroll (8/30/2011)

Now when my business rules kick in I cannot save because it says Row 3 (Now has  an A) causes a duplicate (Because Row 1 even though it has been removed from the BO. is still in the Database

This could be tricky, but that is not the case.  The deleted record is still in the BO.DataTable and when saved, it will send the instructions to the database to physically delete it.  Check the "Saving Data" topic of the SF help file to see the saving sequence done by SF.

On the other hand, you could try setting the bo.ErrorSavingMode = ContinueOnError to avoid the error message, and continue with the Save process, but I am not sure if that will give you the effect you want nor if that would cause invalid records to be saved at some point.

I learned by experience that users don't know the difference between soft delete (as in VFP) and hard delete, so in some bulk cases I soft delete the rows and then save them in a single call, but when need to interact like in your case I will simply hard delete the record.

Edhy Rijo

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