Hi,
When I calculate the End Date from the Start Date the start date is also set to End date.
This is the code i used to set the end date but once i set the end date the start date value is also set to the end date value.
function calculateTenancyEnd() {
var Month = Xrm.Page.data.entity.attributes.get("month").getValue();
var StartDate = Xrm.Page.data.entity.attributes.get("startdate").getValue();
if (StartDate != null) {
if (Month != null) {
StartDate.setMonth(StartDate.getMonth() + Month);
StartDate.setDate(StartDate.getDate() - 1);
Xrm.Page.data.entity.attributes.get("enddate").setValue(StartDate);
}
}
}









