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. .
Trackback this post | Subscribe to the comments via RSS Feed