CRM Calendar Control Bug – DataValue returns incorrect value

November 16, 2009

While doing some date verification against a CRM date control with JavaScript I came across a bug. When getting values from CRM UI controls we typically use the [Control].DataValue property. What i’ve found is when users use the actual Calendar control to select the date things work fine. However, if users type in a date into the field and you have code that gets the date via the .DataValue or .DataXml property it will NOT return the updated date.

In order to guarantee getting the latest value, I had to go against the raw HTML .value property while using some of CRM’s date format methods.

var dt = new Date();
dt = new Date(ParseDate([CRM_Date_Control_Id].getElementsByTagName("INPUT")[0].value))

Entry Filed under: Bugs, Programming. .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

November 2009
M T W T F S S
« Sep    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Most Recent Posts