11 Relax DAL Date Validation During Rule Mapping

An argument can be made that assigning data that does not meet the field’s definition should be an error. During manual entry, this validation is indeed enforced. However, many rules that map data do little in the way of validation before assigning to the field. This legacy behavior continues such that we do not invalidate customer resources that have been long accepted. For instance, a move_it rule can map text data into a field declared numeric and likewise any text into a field declared as a date. For many legacy rules, this is not considered an error during field mapping, even though the data may be contrary to the field’s definition. Succeeding rule additions, like AnyToAny, does utilize the field’s formatting attributes and does validation.

The DAL SETFLD() function also relies upon the calling application (entry versus rules) to determine whether to accept data assigned by DAL script. The recent feature providing date field future/historic attributes added date validation for all DAL type fields. This is true whether the date field used the new attributes. This means a legacy environment may encounter a DAL error if a DAL script attempts to assign non-date value into a date field using the SetFld() function.

If you encounter this date validation error from rule mapping a date field using a script, you have two options.

  • Change the field type within the affected section to be alphanumeric instead of a date.
  • Add a new INI option to relax the validation and preserve the legacy behavior.

If you change the field to alphanumeric, it can accept any data. Committing the resource with the field change means the problem goes away without having to fix the script.

If you don’t wish to change the resource field declaration, a new INI option is available to relax the validation. Remember this option only affects the execution of DAL scripts called from Gendata/Genprint. As mentioned earlier, manual data entry would have always enforced date validation, whether assigned from a script or not.

<Gendata> 
RelaxDALDateValidation = Yes 

The default is not to relax validation because it is assumed a field’s type should validate the data. Adding this option set to “Yes” will relax the validation to what was previously allowed. Remember it only applies during Gendata/Genprint processing.