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
Ritik DwivediRitik Dwivedi 

validation rule on date of birth

when  candidate enter date of birth he/she must be greater than 18 years. how can i write the conditional formula ?
ShirishaShirisha (Salesforce Developers) 
Hi Ritik,

You can calculate the age using the birthdate and then you can write the validation rule on the age using below doc:

https://developer.salesforce.com/forums?id=906F00000008zSTIAY

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
lohi tejlohi tej
Hi Rithik.. Any other birthdate is valid (maybe the user actually is 11 years old, or 108). But the overall form may be refused by business rules. For ex: "You must be at least 18 years old to apply." The idea is to separate individual field validation from form validation.
From MyBoy Emulator (https://myboyapk.fun/) Company.
snehil kumarsnehil kumar
Hi,
Calculate age by the help of following formula 
You can do this in a Formula Field.
 
Formula is:
IF(MONTH(TODAY())>MONTH(Birthdate),YEAR(TODAY())-YEAR(Birthdate),IF(AND(MONTH(TODAY())=MONTH(Birthdate),DAY(TODAY())>=DAY(Birthdate)),YEAR(TODAY())-YEAR(Birthdate),(YEAR(TODAY())-YEAR(Birthdate))-1))

and add the codition, to compare the age to 18.

With Regards,
Snehil kumar