Hi,
i have to add a company established date field in CRM form with the following requirement.
Hi,
i have to add a company established date field in CRM form with the following requirement.
Hi Siva,
You can use regex validation for year to address here are some of the links which may be helpful to you.
1. https://www.regextester.com/93651
2. https://www.py4u.net/discuss/340793
3. https://stackoverflow.com/questions/17547710/javascript-regex-validate-years-in-range
If you can get exact regex using above link then you can just check with Regex.Match to address your requirement.
If not then you can perform below operation-
1. Check Regex.Match with 4 digit number ^[12][0-9]{3}$ ( Validate from 1000 - 2999)
2. After above regex check you can validate it with current year using -> new Date().getFullYear()
3. Code will be some how as below,
function Year_Validation(input)
{
var Year = /^[12][0-9]{3}$/;
if((input.value.match(year))
{
currentYear =
new Date().getFullYear();
if(
currentYear <= input){
// Perform Operation
}
} else { alert("This is not a valid year"); } }
Hope this help you, If it is helpful pls mark as Verified Answer, which will help others as well. Thanks!
Hi Siva,
You can find a a step-by-step guide to add events listeners and validation here: www.languagetechfunda.com/.../validate-end-date-greater-start-date-dynamics-crm
If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.
Thank you.
Yes, i have to include the year field in the Entity's main form and save the value.
Thank you,
Siva
Hi Siva,
Would you please indicate whether you need to insert the Year field into an entity's Main form or a Marketing Form?
Best Regards,
Nya
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156