Business Scenario :
I want to get day from createdon field.
But createdon filed get date and time when we save the form.
please help me how to get day from createdon field using java script.
I wrote JS LIKE below
function GetDay(){
var objDate = Xrm.Page.data.entity.attributes.get("createdon").getValue();
var intDay = objDate.getDay();
var weekDay;
switch(intDay) {
case 0:
weekDay = "Sunday";
break;
case 1:
weekDay = "Monday";
break;
case 2:
weekDay = "Tuesday";
break;
case 3:
weekDay = "Wednesday";
break;
case 4:
weekDay = "Thursday";
break;
case 5:
weekDay = "Friday";
break;
case 6:
weekDay = "Saturday";
break;
}
Xrm.Page.data.entity.attributes.get("new_createdday").setValue(weekDay);
}
Iam getting error like below
*This post is locked for comments