Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Get Year and Month

$
0
0

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


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>