This documentation is archived and is not being maintained.

Duration

Dynamics
banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Duration fields are presented as a picklist giving the user a selection of time options from 1 minute to 3 days. But the actual value of a duration field is an integer. If a user types an integer into the field or your code sets the value of the integer representing minutes, the field will convert that value into a more user-friendly unit of measurement. For example, 420 will be displayed as 7 hours.

The following properties are available:

Duration propertiesTypeDescription
{Field}.DataValueinteger or NullGet/set property.

The duration can be set to Null. The original value is left unchanged if the new value cannot be parsed.


Example

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

var iMinutes = 60;

crmForm.all.SOME_DURATION_FIELD_ID.DataValue = iMinutes;

See Also

Concepts

Other Resources


© 2010 Microsoft Corporation. All rights reserved.


Show: