CRM Calendar Control Bug – DataValue returns incorrect value

November 16, 2009 at 7:20 pm Leave a comment

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))

Advertisement

Entry filed under: Bugs, Programming. Tags: .

Calling WCF service from a CRM Plug-In

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

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


Follow

Get every new post delivered to your Inbox.