Skip to content

Instantly share code, notes, and snippets.

@butchera
butchera / CalculateContractEndDate
Created August 8, 2017 19:45
CRM 2016 Calculate Contract End Date with Moment.JS.
//below function calculates the contract end date and allows the date to be overriden if required.
function calculateContractEnd()
{
//Check if the override date radio button is selected
if(Xrm.Page.data.entity.attributes.get('s00_overrideenddate').getValue())
{
//Enable field to allow it to be overwritten
Xrm.Page.ui.controls.get("s00_contractenddate").setDisabled(false);
}
else