Megan Hagedorn 4 Comments

This tip is meant to save yourself a little time (every second counts, right?) when completing forms in CRM.

Sometimes fields can be filled in on forms by default if the response is typically true under X condition(s). For example–you might know that if an opportunity or lead is related to Product X or Y, it applies to Business Unit A, while if the interest is in Product Z, it applies to Business Unit B. You use a Business Rule on a form to set the conditions and default values. Being default values, they can be changed after they are set.

In this example, we’ll be setting the default value of a currency field to 0. This is actually a very good practice–any blank currency fields used in calculations will cause the calculations to fail.

Navigate to the form you’ll be making these changes on. You can actually do this two ways–either by going to Settings -> Customizations -> Customize the System. Expand Entities, then navigate to the Entity where your form is. Expand that, then select Forms. Note that you can also access Business Rules from here:

Or, you can get to the Entity via the main navigation menu, then open a record or select “new”, then select Form in the menu (next to Delete). FYI, this will only open the default form–even if you change the form:

Identify the field that will have the default value, and think about the conditions that determine the default value.
In the form editor, select Business Rules, then New Business Rule:

Set the Scope appropriately. In this example, we’ll be setting the default value of the Budget Amount field to $0, since it is a currency field. We want to use a condition that will always be met: If field Topic contains data, then set default value to $0. This will require you to save or refresh the form after you’ve met the criteria before it will set the default value! Make sure you Apply the condition before moving on with the action (or, the Then):

Select Add, then Default Value from the drop-down list, then select the + area next to the checkmark:

After you set the Default Value information, remember to click Apply, then Save, then Activate:

You’re all set! Give it a go. Remember to Save or refresh the form after you’ve fulfilled the criteria , or it won’t set the default value.

Note: You can also set the default value of an option set or 2-option field when you create it in the Solution:

 

Please comment below or contact me at megan@marksgroup.net if you have any questions. Thanks!

— 4 Comments —

  1. How would one go about setting a default value for a multiple lines text field *with* line breaks using a business rule? I’ve only found Javascript samples that can supposedly do this, but I can’t get them to work — perhaps because I’m trying this on fields that have their visibility controlled with a business rule.

    • Hi Roland,
      I’m not sure it’s possible to do that with a business rule–but have you tried a workflow instead? I believe that would preserve the line breaks. Good luck!

  2. Is it just null currency fields that Dynamics wont calculate in a calculated field, or other fields as well like null whole number fields?

    • Hi Marc,
      Right–any null number fields used in a calculated field (including currency, whole number, decimal, etc) will cause the calculation to fail, so it’s best to always set the default value of those to 0.

Leave a Reply

Your email address will not be published. Required fields are marked *