alex wrote:
Our original intent was to have all validation including checking for required fields in the business objects (server side). We didn't want to use client side validation.
Since it's not going to work any more, we'll have to think about changing design, unless you could reverse this particular change to the SetNewFieldValue method.
No, I won't reverse this, sorry.
Selfservicing already tested on this since the beginning, as the nullability of a column was available. In Adapter this wasn't the case until 1.0.2004.2, it always accepted null values while it wasn't correct.
Entities for example also check for lengths of binary values and strings. if you pass in a 100 char string to a field which has a length of 10, the value won't be set either.
I understand that the reason why you chaged behavior of this method was to avoid runtime exceptions if the developer sets a null value in the field that is mapped to the database column that does not allow nulls. But if the developer does this by mistake, the runtime exception is appropriate, so the developer can correct his or her code. If the developer does something like this intentionally (like in my case), let them handle this situation. I think, the purpose of the SetNewFieldValue method is to set the value that is passed to it, so let it do it!
If you want to bypass value checking, you should use:
entity.Fields[index].CurrentValue = value;
Be sure to set entity.Fields.IsDirty to true as well.
Did you change this method because someone reported a defect?
Yes, and because it was logical to do so, the behavior was changed.
I'm very sorry you ended up in this situation. It's often the case we have to make a choice between a rock and a hard place, as one customer reports an error so he can't continue, but by changing it other people run into problems and can't continue... This change is made over a version change, so it could be expected.
I have to admit, I didn't foresee your situation and the downside of having this. From the beginning the phylosophy was that error-preventing checks were done in the entity, by the entity, rule validation was done outside the entity, by plugged in objects (so executed in the entity, by the entity, but not part of the entity's core code).