Created
October 13, 2021 20:05
-
-
Save D4R4/a9801eca229a71c1909fdb7c75ab740a to your computer and use it in GitHub Desktop.
Take date form field value and add days to it. Dynamics 365 Web Resource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addDays(date, days) { | |
var result = new Date(date); | |
result.setDate(result.getDate() + parseInt(days)); | |
return result; | |
} | |
function recalculateDateFieldValue() { | |
var date= Xrm.Page.getAttribute("effectivefrom").getValue(); | |
if (date != null) { | |
Xrm.Page.getAttribute("effectiveto").setValue(addDays(date, 30)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment