web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2011 RU12 date picker/java script issue

(0) ShareShare
ReportReport
Posted on by 95

Just installed RU12. We have some simple java script on some date picker fields. One example sets the default "time" to 8:00. The script worked greate prior to RU12. Now the date picker is acting up and the year for the date is showing 0113 instead of 2013. If you choose a few different dates it figures out the correct year. Anyone else seen this or found an answer? Here's the java script.

RU12 doesn't like something in this script.

function new_compdate_onchange()
{
var dateField = Xrm.Page.getAttribute("new_compdate");
var currentValue = dateField.getValue();

//If the user changes the date field from null to a valid date, set the
//time portion to 8:00
if ((currentValue != null) && (_previousValue == null)) {

var newDate = new Date(
currentValue.getYear(),
currentValue.getMonth(),
currentValue.getDate(),
8, 00);

dateField.setValue(newDate);
}

Thanks,

Mark

*This post is locked for comments

I have the same question (0)
  • Matthew Killebrew Profile Picture
    170 on at

    Mark, We are having a similar problem. Since RU12, most of our javascript either quit working or is not firing at all.

  • Verified answer
    Jack Dall Soelbeck Profile Picture
    on at

    Hi

    Had the same problem, you need to use getFullYear instead of getYear

  • Mark Coleman Profile Picture
    95 on at

    Jack, you are the man! That fixed it. Weird that it only cropped up with RU12 but that fixed it. Thank you! I had to update some other javascript because of RU12 and then updated the CRM list component for SharePoint after our document integration broke. It was an interesting day running around fixing things that RU12 broke but its all good now. Last thing I need to do is get Google Chrome working. Its prompting for credentials and won't accept anything. Lots of reading to do on this one.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans