## c## Change system code
#1. in the `u:OnBeforeItemCreatee` event, after `$object` variable iwas initialized, add these lines:
- $object->SetDBField('FirstName', array(1,2,3));```
- $object->SetDBField('MaxValueInc0Valid', 0);lang=php
- $object->SetDBField('MinValueInc0Valid', 0);FirstName', array(1,2,3));
- $object->SetDBField('MaxValueExInc0Valid', -5);0);
- $object->SetDBField('MinValueExInc0Valid', 5);0);
- $object->SetDBField('MaxLen2ValueExc0Valid', '1');-5);
- $object->SetDBField('MinLen2ValueExc0Valid', '22');5);
- $object->SetDBField('MaxValueInc0InLen2Valid', 5);'1');
- $object->SetDBField('MinLen2Valid', '22');
$object->SetDBField('MinaxValueInc0InValid', -5);
- $object->SetDBField('MinValueInc0InValid', -5);
$object->SetDBField('MaxValueExc0InValid', 0);
- $object->SetDBField('MinValueExc0InValid', 0);
- $object->SetDBField('MaxLen2InValid', '333');
- $object->SetDBField('MinLen2InValid', '1');
```
#2. in the `users_config php` remove `type` key from `FirstName` field configuration (to bypass type validation)
# in the users_config php add elements to 'VirtualFields' array:
- 'MaxValueInc0Valid' => Array ('type' => 'int', 'max_value_inc' => 0),3. in the `users_config php` add elements to `VirtualFields` array:
```
- 'MinValueInc0Valid' => Array ('type' => 'int', 'min_value_inc' => 0),lang=php
- 'MaxValueExInc0Valid' => Aarray ('type' => 'int', 'max_value_exinc' => 0),
- 'MinValueExInc0Valid' => Aarray ('type' => 'int', 'min_value_exinc' => 0),
- 'MaxLen1'MaxValueExc0Valid' => Aarray ('type' => 'string'int', 'max_lenvalue_exc' => 10),
- 'Min'MinValueExc0Valid' => array('type' => 'int', 'min_value_exc' => 0),
'MaxLen1Valid' => Aarray ('type' => 'string', 'min'max_len' => 1),
- 'MinLen1Valid' => array('type' => 'string', 'min_len' => 1),
'MaxValueInc0InValid' => Aarray ('type' => 'int', 'max_value_inc' => 0),
- 'MinValueInc0InValid' => Aarray ('type' => 'int', 'min_value_inc' => 0),
- 'MaxValueExc0InValid' => Aarray ('type' => 'int', 'max_value_exc' => 0),
- 'MinV'MinValueExc0InValid' => array('type' => 'int', 'min_valueExc0_exc' => 0),
'MaxLen2InValid' => Aarray ('type' => 'int'string', 'min_value_exc'max_len' => 02),
- 'Max'MinLen2InValid' => Aarray ('type' => 'string', 'max'min_len' => 2),
- 'MinLen2InValid' => Array ('type' => 'string', 'min_len' => 2),```
## Testing
## testing
# login to Admin Console
# go to {nav User Management > Users} section
# press `Add` toolbar button
# press `Save` toolbar button
# confirm that no `strlen() expects parameter 1 to be string, array given` among resulting errors in the derror or similar is reported in Debugger
# confirm that no errors with "`Valid"` group of added virtual fields among resultingdoesn't report any errors in the dDebugger
# confirm that all six "`value_out_of_range"` errors with "from `InValid"` group of added virtual fields appears among resultingreport errors in the dDebugger