Hi, does anyone know how I can compare two date fields, select the newest of the two and populate a third date field in CRM using JavaScript?
*This post is locked for comments
Hi Graeme ,
you can definitely compare two dates using > or < operators.
have a look : stackoverflow.com/.../compare-two-dates-with-javascript
you can compare if (a>b)
a will the newest one.
For clarity, are you trying to update the third date field with the later of the two dates? If so, you could achieve this using business rules:
IF
Date A > Date B
THEN
Set Date C = Date A
OTHERWISE
Date B > Date A
Set Date C = Date B
See below:
Hi Graeme, check this,
dynamicscrmguru.com/.../how-to-compare-dates-using-javascript
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Community Member 2
HR-09070029-0 2
UllrSki 2