Hi All,
I'm running into an issue and I can't seem to find a solution. I am attempting to create some Javascript that will run on form load, compare two dates, and populate an option set, but everything I try spits out:
I've tried multiple different ways to write the script, and below is how it currently sits. My Javascript is a little rusty, and any help that anybody can offer would be much appreciated.
Version: On-Premise 2013
Activity:
Compare date in a field against today's date, and populate an option set with 'Yes' (value 100000000) if it is within 4 days.
Javascript:
function CalcDaysDifference()
{
var today = new Date();
var lastAction = Xrm.Page.getAttribute("LastActionDate").getValue();
if(lastAction != NULL)
{
if (today - lastAction <= 4)
{
xrm.page.getAttribute("LastActionWithin4Days").setValue(100000000);
}
}
}
*This post is locked for comments