function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cloud lendingcloud lending 

Incorrect argument type for function 'REGEX()'.

I have a field like 'Apartmentnumber'.data type number(16,0).
for this i have written validation like this
NOT(REGEX( Apartment_Number__c, "^[0-9]+$"))

i am getting an error
 Incorrect argument type for function 'REGEX().

can any one solve this validation
 
Tolga SunarTolga Sunar
You are allowing "+" in REGEX function, which can not be inserted into a number field.
Vijay NagarathinamVijay Nagarathinam
Hi Cloud lending,

Use the below rule, it will work
 
NOT(REGEX(Text(Apartment_Number__c),"^[0-9]+$"))

Let me know if you need any help regarding this.

Thanks,
Vijay