Validation of date of birth

Shubham Gagneja
Tera Guru

I want to validate date of birth and set a error message if the date of birth is less than 14 years of age.  So if the date of birth is less than 14 years of age then there will be an error message. I have done this from my side but it still not working. I have added the error message but I think there is something wrong with the condition. Need helpfind_real_file.png 

3 REPLIES 3

Logan Poynter
Mega Sage
Mega Sage

Hello,

Catalog UI Policy:

find_real_file.png

Script:

find_real_file.png

function onCondition() {
    g_form.addErrorMessage('Date is less than 14 years ago!');
}

 

Demo:

find_real_file.png


Please mark my answer as correct/helpful if it has helped you.

Thanks,
Logan
--
LinkedIn

NS16
Mega Sage

Hi Shubham,

Here is catalog UI policy, script and result

 

find_real_file.png

find_real_file.png

Result:

find_real_file.png

Please mark my answer as correct/helpful if it has helped you.

 

Thanks,

Neha

asifnoor
Kilo Patron

Hi Shubham,

Where are you testing this? Is this on catalog item or on the ritm/task? if you are testing on ritm/task, then seelct the "Applies on target record" chckbox also in your catalog script and check.

Couod you also check if you have placed the error rightlyas the condition looks fine. hope you are using the right field name there.

Mark the comment as a correct answer and helpful if this has helped to solve the problem.