Customizing the Status Reason Field Dynamics CRM 2011

Paul Nieuwelaar, 20 September 2011

In dynamics CRM 2011 sometimes you will have a custom entity, for example ‘Project’, which requires an option set to store the Project Statuses such as ‘In Progress’, ‘On Hold’, ‘Completed’, and so on. At first glance this looks like a custom option set called ‘Project Status’, however a much more effective method is to customize the ‘Status Reason’, which by default has only ‘Active’ and ‘Inactive’ values. By modifying the Status Reason we can assign different ‘Reasons’ to each status (Active/Inactive for custom entities), meaning we can get a more controlled, and defined status.

 Customizing the Status Reason Field Dynamics CRM 2011

A Status Reason is quite simply a reason for the status. By using the Status Reason, all the Project Statuses that should be available while the record is active, such as ‘In Progress’ and ‘On Hold’ can be added to the ‘Active’ status. Any Project Statuses that should be selected when the record is closed, such as ‘Completed’ and ‘Cancelled’ can be added to the ‘Inactive’ status. This means when you try and deactivate a record you will be asked to select a Status Reason (this only applies if you have 2 or more ‘Inactive’ status reasons).

 Customizing the Status Reason Field Dynamics CRM 2011

To customize the Status Reason, simply open the Entity Customizations, navigate to Fields, and locate the ‘Status Reason’ field (called ‘statuscode’). Double click the field to edit it, and then go down to when it has the different values (you should just see ‘Active’ for custom entities).

You can double click the ‘Active’ option to change the name. You can then add new values to the ‘Active’ status, and finally to the ‘Inactive’ status by changing the Status option set. With the ‘Inactive’ status selected there will again be only one option called ‘Inactive’, which can be relabelled.  You will also notice that you are unable to change the Data Values using this method. Once all your values are added, you can assign a Default Value for each status group.

 Customizing the Status Reason Field Dynamics CRM 2011

Once you have customized the Status Reason to your liking, you can save and close the field editor, and then add the Status Reason to the form if required. Finally publish your customizations to preview the results.

If you create a new record, all the ‘Active’ options will be available to choose from the Status Reason. If you save the record, or open an existing record and then click ‘Deactivate’ you will be prompted to select a Status Reason (from the options added to the ‘Inactive’ status). Once a status reason is selected the record will be deactivated, and the Status Reason will be set to the selected option. On reactivation of the record it will be set back to the default status reason for ‘Active’.

 Customizing the Status Reason Field Dynamics CRM 2011

You can also fully customize the Status Reason for out-of-the-box entities. With Cases for example, there are 3 Statuses by default (Active, Resolved, and Canceled), so you can add different Status Reasons to each of these.