Strange Problem when checking business rules


Author
Message
PeterA
PeterA
StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)
Group: Forum Members
Posts: 72, Visits: 235
I've been fighting this and I know it must be something I'm doing, but I can't seem to figure out what's causing it. I have a business object that has several date fields. Some of the date fields indicate a start date and an end date.



In the business object's CheckRulesOnCurrentRow event, I have a rule that makes sure the start date doesn't occur after the end date. When I save a record, it correctly makes this check and saves the data if I get it right the first time. If I set the start date after the end date, it adds a broken rule and lets the user correct the problem.



I set the start date earlier, and save. I get the same message and the bound control is reset to the same later value. I keep making the change and it always switches back to the old value. The only thing I can do is click my cancel button to undo everything and start from scratch.



So far, I've tried...



... checking my code and I don't have a RejectChanges() or Refresh() call anywhere in the save process. The Undo() is only called from the Undo/Cancel process.



... Adding this.BrokenRules.Clear() to the beginning of the CheckBusinessRulesOnCurrentRow event for the business object.



Anything else I might try? Any ideas?
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