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?
Replies
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Greg will be glad to know that we have found his issue relating to the DateTimePicker and we are working on a fix now.




BigGrin Very good news.



I only mentioned the DateTimePicker as there was the possibility it was control related, based on my experience, rather than binding/BO/Database related issue. Trying another control could quickly narrow that down.
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
Greg McGuffey (02/19/2008)
Greg will be glad to know that we have found his issue relating to the DateTimePicker and we are working on a fix now.




BigGrin Very good news.



I only mentioned the DateTimePicker as there was the possibility it was control related, based on my experience, rather than binding/BO/Database related issue. Trying another control could quickly narrow that down.




The only thing is that I'm on a Web-based application and not a WinForm. I'm not using a date picker control, but a popup window with a modified calendar control to set the value of the text boxes to which I bound data.



Hopefully I'm not stomping on any glimmers of hope. BigGrin
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Ah, I see. I don't think this stomps out all hope. BigGrin



You might try to eliminate the little pop-up thingy (comment out the code in the prerender event) and see if the textbox by itself exhibits this behavior. I don't see how this could be the problem, but... plus, this should be a quick test so you could eliminate that part of your code immediately as the problem. Quick tests are good BigGrin



And as Trent said and as I've found, a simple app that can reproduce the problem is invaluable, especially when the problem is being an elusive little bugger. (I'm sure you know this...but I resist it every time and it always ends up being the quickest way to the solution in these sort of situations).



Good luck!



P.S. I'm about to leave (within an hour or so) for a little vacation, so I won't be posting for 11-14 days. Until then....asta la pasta!
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
Greg McGuffey (02/19/2008)
Ah, I see. I don't think this stomps out all hope. BigGrin



You might try to eliminate the little pop-up thingy (comment out the code in the prerender event) and see if the textbox by itself exhibits this behavior. I don't see how this could be the problem, but... plus, this should be a quick test so you could eliminate that part of your code immediately as the problem. Quick tests are good BigGrin



And as Trent said and as I've found, a simple app that can reproduce the problem is invaluable, especially when the problem is being an elusive little bugger. (I'm sure you know this...but I resist it every time and it always ends up being the quickest way to the solution in these sort of situations).



Good luck!



P.S. I'm about to leave (within an hour or so) for a little vacation, so I won't be posting for 11-14 days. Until then....asta la pasta!




Yea, I eliminated the onFocus event addition in the PreRender event. It didn't solve the problem.



Honestly, this whole application is pretty simple. One Web page with several fields bound to two business objects. I've been having this problem since before I added any of the extra JavaScript items.



Thanks!

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