Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Validation on custom field despite being excluded from INSERT

    Hi, I have a field defined as:
    Code:
    <field name="foobar" type="integer" customSelectExpression="myTable.foo" customSQL="true"/>
    and I noticed that when performing an add, validation is triggered on the field for the integer type.
    This happens even though the field is then ignored for the INSERT.

    Actually, there's a mistake is in my code since the field should have been of type text, but I was wondering whether it is normal that it still gets validated even if it will later be ignored.

    #2
    Yes, that's normal. Although the framework can know in this case that the default SQL generation won't happen for this field value, there's no way for the framework to reliably determine that the field isn't used in some way - there could be a DMI, custom DS, even servlet logic. Since we can't know that the value isn't used, we have to validate it.

    Comment

    Working...
    X