Hi,
I have this function on the OnSave event:
Function CheckInvoiceDate(context)
{
var saveEvent = context.getEventArgs();
var invoiceDate = Xrm.Page.getAttribute("abs_invoicedate").getValue();
var todaysDate = new Date();
if (invoiceDate !== null )
{
invoiceDate.setHours(0,0,0,0);
todaysDate.setHours(0,0,0,0);
if (invoiceDate < todaysDate)
{
alert("The Invoice Date is in the past! Please change it to either today's date or a future date.");
saveEvent.preventDefault();
}
else
{
Xrm.Page.data.entity.save();
}
}
}
Things worked as normal as soon as I removed it.
This has been running without a problem in the Web Client, so it must be something in the Unified Interface (Wave 2) that doesn't like it.