Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Business Rules and Default Values don't work!?
Message
 
To
24/05/2005 17:07:04
Dave Porter
Medical Systematics, Inc.
Merced, California, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01016948
Message ID:
01017311
Views:
22
>>The way I was trying to do it is my attempt to copy what is in the Jump Start, I must have foobarred that.

Without reading through the jump start, I could see how you could it that way, so you may be correct, and didn't fubar anything. Thing is, in the constructor of you business object, you never had a line that said "this.DefaultValues = ...", so when you check to see if .DefaultValues is null, well, of course it is.

>>What I need is a 'before save' check, because now I'm getting an
Application Exception Occured!
Column 'ICDACode' is constrained to be unique. Value '8888' is already present.

There is a HookPreSave method you can override, but you may just want to make it a rule.

The reason I asked *how* are you calling the save is because if you call this.Save on a mmBusinessForm, the broken rules dialog (or the error providers, if you choose that method) will be shown to you automatically. If you're saving like myBizObj.Save(), then the rules are not automatically reported to you, but the mmSaveDataResult will be "RulesBroken". In that case, you should check the result of the save operation and take appropriate action.

Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform