Hi Al,
The default values are set when the new entity is first created and not again after the user edits the data.
The rules on the other hand run after the save is initiated and can be customized to do whatever you want. If you want to pre-test for empty and return a broken rule you can. Also, if you want to pre-test for zero and return a broken rule you can. You could even in your UI ask the user if they intended to leave that value set to zero. If zero is acceptable but not likely then I would probably not set the default, but set my rule up to allow zero but decline an empty value. Rules are customizable method to your desire. I hope that helps.
Tim
>Kevin,
>
>That would work in some cases, but I have a requirement where zero is the least likely value so it wouldn't make sense to default it to zero. There is also the possibility of the user accidently deleting the value and then zero would inadvertently be inserted. I could probably prevent this with client-side validation, but doesn't that kind of defeat the purpose of having the business rules in the business objects?
>
>I think part of the problem is that the web controls are really text based controls (HTML) where an empty string is natively acceptable. The MM datasets retain the null value but the entities do not when the column is non-nullable.
>
>Al
Timothy Bryan