In This Article

    Share

    CRM Business Rules + Calculated Fields = Amazing

    If you have read our blog for long, you know that we love the new calculated field feature in Dynamics CRM 2015. It’s never been easier to perform real-time calculations. But sometimes, your calculated fields (or rollup fields) may not calculate correctly—the field is blank.

    This is often caused by one of the fields in the calculation not containing data. If one of the fields in the calculation has a null value, the calculation result will be null.

    This can be avoided by using one of the other great new features in Dynamics CRM 2015: default values in business rules.

    For example, say I have a calculation that involves a number of different number fields. I want to make sure that the fields have a default value of 0 so that my calculation can happen even if one of the fields is blank.

    • Create a business rule called “Default Values.” Set the scope to “entity.”
    • Add an action for each field that you want to default to set the default value to 0 for each field involved in the calculation. No condition is necessary.
    • Activate the rule.

    Screenshot 2015-03-03 15.08.42

    By setting the scope to “Entity,” the rule will fire for all records created, not just those created via the form.