Validation Trigger converts empty integer fields to "0" if field is left empty. I am trying to use a validation trigger to make sure a field has data in it, before the form can be submitted.
Example:
if ("{!number_units}" == "")
return "The Number of Units was not entered. Please fill in the field 'No. of units' to continue."
When I debug the trigger with a record that I know has left the field blank. I get:
function wrapper() {
if ("0" == "")
return "The Number of Units was not entered. Please fill in the field 'No. of units' to continue."
}
wrapper();
RESULT: null
It looks like your field number_unit is numeric. In this case empty (null) value for this field is 0, not "".
Anyway, use safer syntax:
if ("{!number_units}" == "" || "{!number_units}" == "0") ...