Duration Fields in Dynamics CRM 2011

Roshan Mehta, 16 January 2013

Microsoft Dynamics CRM 2011 has been out for a while now so you probably know about custom duration fields. Duration fields were previously found only on system entities and there was no way of adding custom ones to entity forms. In this post, we will take a closer look at duration fields and understand the control we have over them.

 Duration Fields in Dynamics CRM 2011

The image above shows an example of a duration field on the Phone Call entity.  Notice how durations are displayed in a drop-down list in minutes, hours and days ranging from 1 minute to 3 days. When a user selects a duration value and saves the form, the data in the field is stored in the database in minutes as shown in the actualdurationminutes column.

 Duration Fields in Dynamics CRM 2011

One important factor of the duration field is that you’re not limited to the values displayed on screen. Users can simply type into the field to add a custom entry. As mentioned above, the upper limit displayed on the field is 3 days. If a user wanted to specify a duration of 30 days, they can simply type it into the field and save the record. The image below shows the result of modifying the duration to 30 days.

 Duration Fields in Dynamics CRM 2011

 Duration Fields in Dynamics CRM 2011

Depending on your implementation, the ability to add custom entries to the duration field can be dangerous. In my next post, I will show you how to use JavaScript to restrict the allowable values of a duration field.