sc_field_no_validate('field_name')

The macro can only be used in the onLoad event of Form, Control and Calendar applications.
It allows ignoring the validations of the fields informed in the parameter, allowing the developer to dynamically "remove" the validations according to his business rule.

It is worth mentioning that only the validations defined in the field configuration screen will be ignored by the macro. Validations created by the developer in events, methods or libraries will not be considered.

Check some validations that will be ignored with the use of the macro.

  • Field data types: Date, credit card, email, and zip code.
  • Formatting text field values: Maximum, minimum value and characters allowed.
  • Formatting numeric field values: Maximum and minimum value.
  • Fields marked as mandatory.

See below for details about the macro parameter.

Macro Parameter

Parameter Syntax Description
field_name

The parameter expects to receive the name of the fields in quotes (single or double) or in curly brackets {field_name}. It is also possible to enter two or more fields, in which case the names must be separated by a comma.


Syntax with a field

// field name in quotes
sc_field_no_validate('field_name');
// field name in curly brackets
sc_field_no_validate({field_name});

Syntax with two or more fields

// Two and more fields
sc_field_no_validate({field_name1}, {field_name2});

This parameter is mandatory and must receive the name of the fields that will have the validation disregarded.

It is possible to inform more than one field, in this case, the names must be separated by a comma.

 

Lista de Exemplos

 

Removing validation from a field hidden by the macro sc_field_display.

sc_field_display({field1}, 'off');
sc_field_no_validate({field1});

 

Example using multiple fields in curly brackets.

sc_field_no_validate({field1}, {field2}, {field3});

 

Example using multiple fields with quotes.

sc_field_no_validate('field1', 'field2', 'field3');