How can I add custom validation to a custom field in suitecrm 8?

I have a requirement to validate a custom field named movil

The field value can accept any of these formats

91xxxxxxxxxxxx
+91xxxxxxxxxx
0091xxxxxxxxxx

How can I add custom validation to a custom field in suitecrm 8?

What is your standard format

Hello. Thanks for answering. Sorry I don’t understand the question

You could set number to be 10 digits long from studio

I had asked @clemente.raposo about Field masking in v8 but still its not supported.
Can we have an updated documentation on how to add field masking or custom components to add this customisation.

Following this. An absolute must have!

I think we can set the validation of phones, emails in .yaml file under config. Can you please try the following

Copy {ROOT}\config\services\ui\ui.yaml at {ROOT}\extensions\defaultExt\config\services\ui\ui.yaml
Change the validation regex expression which is present at the end as shown below

validations:
      regex:
        phone: '^(?:\+91|91|0091)?[0-9]{10}$'

Run command : php bin/console cache:clear from the root folder of suite8 instance.

1 Like