CRM 2013 – Toggle Time Portion of Date Fields

The Xrm.Page.ui.control namespace of the Microsoft Dynamics CRM 2013 SDK provides a new function to programmatically show or hide the time portion of a Date and Time field in a supported manner. Here’s how!

To show both the date and time portion of a Date and Time field:

Xrm.Page.getControl(“ros_date”).setShowTime(true);

clip_image001

To hide only the time portion of a Date and Time field:

Xrm.Page.getControl(“ros_date”).setShowTime(false);

clip_image002

Unfortunately, there are no SDK functions to allow you to show only the time portion of a Date and Time field, however you can achieve this using unsupported customizations.

Advertisements

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 )

Google+ photo

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

Connecting to %s