I have a DateOfBirth field, on the form load I am fetching DOB of Customer and based on some check hididng and showing some fileds on the form.
My Requirenment is to calculate the age based on DOB on form initializing and show/hide some fields. Please suggest me proper a way to calulate the age from DOB ?
Solved! Go to Solution.
You can calculte age using expression that calculate difference between dates. You will subracct date of birth from system current date.
Please see below documentation for more information of time and date expression:
Good Day Shubh
You can use the day difference expression to determine the day difference between the current date and the date of birth, this will return a number value. This number value would then need to go through a conditional check to see if it is less than 365 (total amount of days in a year) in which case the result would be displayed in days OR if the number value is greater than equal to 365 then the result would be displayed in years.
Please see the below configuration steps in order to setup the above explained (Please see the below screenshots):
The above configuration will result in the following behaviour (Please see the below screenshots):