Business Rules in Dynamics 365

Basic logics and common sense is what runs most of our business whatever innovators they claim themselves to be. If there is not basic logic into the applications, the quality of data can go for a toss which will have an impact across all innovations which makes the data as the foundation for further processing and analytics. These logics could be dynamic in nature and most of the times organizations would prefer to have control in that section especially through administrators rather than involving developers to make the changes. IT Service providers used to come up with many accelerators and other tool kits to provide something similar to help organizations regarding that but it went to the next level when Microsoft itself brought in the Business Rules into the Dynamics 365 environment. Today in this blog, we will talk about the business rules and its capabilities. Hope you enjoy this one as well.

Business rules helps us to create rules and recommendations to apply logic and validations from a no code perspective. Its through simple drag and drop and also by simply selecting some values from a UI and then enable the same. Here the business don’t need the help of a developer, everything can be done by the administrator via a simple interface to implement and maintain the same. Administrators can also apply business rules for a table to all the table forms and at the server level. Business rules applied to an entity/table apply to both canvas and model-driven apps in case the entity/table is used in the app. One thing to note here is that all the actions available for the model-driven app will not be applicable for the canvas app. In general using the conditions and actions we can do all the below actions using business rules. Out of which the ones in bold are not available for Canvas Apps. Others are available for both Canvas and Model-Driven apps

  1. Set Column Values
  2. Clear Column Values
  3. Set Column Requirement Levels
  4. Show/Hide Columns
  5. Enable/Disable Columns
  6. Validate Data and Show Error Messages
  7. Create Business Recommendations based on Business Intelligence

While we are creating a business rule, we should make sure that the scope of the same is set to what is required for us. In case we are setting to entity/table, then the scope is set to model-driven forms and server while if we are setting it to All Forms, then its set to all the model-driven forms. We also have the option to set the scope to a particular form as well. In case, if we are building a canvas app, then we must use the table as the scope and we don’t have much of a choice there.

In the age of globalization, organizations span across different regions crossing the language barriers. Demand for multi lingual applications are very high and business rules also supports the localization of error message. Each time when we set a message, a label is generated by the system. When we export the translations in our organization, we can add the localized versions of our messages and then import those labels back to the system. This way people using other languages will view the translated messages.

Along with all these great features, business rules also have some limitations or issues which are depicted below,

  • Composite attributes/field/columns are not supported with Unified Interface apps. Alternatively, we have to use the rules on all the attributes that comprises the composite attributes. For example, full name may not work, but we can consider using first name and last name so that we can get the same effect for the full name.
  • For a business rule to execute, the field referenced in the business rules should be included in the form.
  • Another thing to be noted is, business rules are triggered before an onload script is executed, so any fields which gets changed as per onload script logic may note get any impact due to the execution of business rules.
  • Since business rules are executed on clients, it will be applicable only for the records created/updated after the activation of the business rules.

Even though business rules does the job for most of the client side stuff, we can’t consider them as a replacement for the JavaScript web resources at this moment. Considering the limitations and the way the business rules are executed we need the existing approaches until business rules can take over completely in near future or may be with a combination of PCF components and business rules, we might be able to implement almost all of the business requirements for different organizations. Thank you for your time reading this blog and hope you got an overall idea about the business rules.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s