StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
WinForms (How do I?)
»
How to Validate Rows against databse whrn not deleting immediately
How to Validate Rows against databse whrn not deleting immediately
Post Reply
Like
0
How to Validate Rows against databse whrn not deleting immediately
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Ger Cannoll
Ger Cannoll
posted 13 Years Ago
ANSWER
Topic Details
Share Topic
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.
Reply
Like
0
Edhy Rijo
E
Edhy Rijo
posted 13 Years Ago
ANSWER
Post Details
Share Post
E
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
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search