banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

A DateTime field can be formatted to show both the date and time, or the date only. The following properties are available:

DateTime propertiesTypeDescription
{Field}.DataValueDate or NullGet/set property.

The original value is left unchanged if the new value cannot be parsed.

{Field}.TimeVisibleBoolean Get property.

This property specifies if the time is to be shown.


The following code example shows how to use a field of type DateTime.

var oDate;
var oToday;

oDate =  crmForm.all.scheduledend.DataValue;
if (oDate == null) {
    oDate = new Date();

oToday = new Date();
oDate = oToday;
oDate = oDate.setHours(17,0,0);

if (oDate.TimeVisible)
   alert("The time is visible.");
   alert("Only the date is visible; the time is hidden.");

crmForm.all.scheduledend.DataValue = oDate;

See Also


Other Resources

© 2010 Microsoft Corporation. All rights reserved.

© 2016 Microsoft