Set Field Default Value in Microsoft Dynamics CRM Online and On-premise using Business Rules without Javascript or custom components: plugins or workflows

A fairly common requirement in many Dynamics CRM implementations  is to set the default value of a field every time a new record is created. Previously, this was done using plugins or JavaScript in older Dynamics CRM versions. Now in Dynamics CRM 2016 on-premise and Microsoft Dynamics CRM Online, it is a lot easier to achieve this using Business rules by using the business rule action : ” set Default Value” available in Dynamics CRM business rule.

However, and that’s the objective of this whole blog post, there is a catch. If you use the business rule action “Set Default Value” to set the default value of a field, the value is set correctly but not in every situation or scenario of creating a new record. It will specifically not work when you create a new record using the “Quick Create” button route.

For example, let’s say you have a new custom entity: project and you have a field called: “Project summary” which you want to set a default value for this field every time a new Project record is created. A business rule that has one action of “Set Default Field Value” as set “Project Summary” equals “some information” will only work in case you click on the “New” button on any “Project” view. However, if you have allowed the “Project” entity records to be created via the  “Quick Create” link at the top and then you tried to create a new “quick” project record using the quick create button, you will find that the field default value has not been set. Apparently, and I stand to be corrected, the Set Field Default Value does not set the value in case of quick Create forms. The workaround that I found for this limitation is to add another action of “Set Field Value” to the same business rule. So if “Project Summary” field is empty, then “Set Field Value” to “some information” – note here this is the “Set field value” action not the “set default field value” one. Having both actions: “Set field Value” as above and “Set Default Field Value” both within the same business rule, seem to work well and catch all different ways of creating a new record. My recommendation is to always have both actions in every business rule where you need to set the default value for a field every time you create this field.