Hi,
I am trying to get the Year and Month from a date field using the following script but its not working
Function getdates () {
var startDate = Xrm.Page.getAttribute("dac_typeofcaller").getValue();
if (startDate != null) {
var year = startDate.getFullYear() + "";
var month = (startDate.getMonth()+1)+"";
alert(month);
alert(year);
}
}
The above script results in the following error :
ReferenceError: getdates is not defined
at eval (eval at RunHandlerInternal (https://xxx.crm11.dynamics.com/form/ClientApiWrapper.aspx?ver=-253954455:153:1), <anonymous>:1:1)
The date field is on the form and its populated
Your help is greatly appreciated.
Thanks