In Microsoft Power Platform and Dynamics CRM Business rules are No Code way of automating form behavior.
You can combine conditions and actions to show or hide fields, set requirement levels, validate data, and show error messages. The YouTube video shows an Opportunity business rule in action that validates the Est. Close Date to be in the future.
This blog outlines the Power Platform steps to build this business rule.
Step 1: Use a Solution
Login to https://make.powerapps.com and make sure to (#1) select the environment that you want to modify.
Then, (#2) either use a solution that you have already started or create a new solution. We are going to focus on the Opportunity, so I’ve created a Solution called “Opportunity”.
Power Apps Solutions
Step 2: Add Opportunity Table to your Solution
Inside your solution, use the “Add Existing” option to add the existing Opportunity Table. Once you have added the opportunity table, your solution will look like the image below:
Step 3: Create a new formula field for the current date time
Formula fields are a new data type available in Power Platform – I’m so excited. I suspect that this new field type will get lots of use and attention in the future.
For the Opportunity Table, create a new formula field. Click on Columns on the left navigation and select “+New Column”.
Enter the column name (“UTC Now”), the description, select “Formula” as the Data Type and then enter the formula “UTCNow” in the formula field as shown in the image below.
Note that at the time of this blog, the Formula functionality is currently in preview.
Add a new Formula Field to Dynamics
Step 4: Create Business Rule
Next, Create a new business rule on the Opportunity table. From your solution, click the Opportunity Table and then click (#!) “Business Rules” on the side navigation.
Then, click (#2) “+ New Business Rule” on the menu as shown in the image below.
Create a new Power Apps Business Rule
Step 5: Add a Condition to your Business Rule
Each business rule needs to start with a condition. The condition for our
business rule will use the new UTC Date field that we created in Step 3.
Our business rule’s Condition will have the following values:
Display Name: Est. Close Date < Now
Entity: Opportunity
Source: Entity
Field: Est. Close Date
Operator: Is less than
Type: Formula
Field: UTCNow
Operator: +
Type: Value
Days: 0
If everything was set correctly on your condition, the Condition Expression should now read “(Est. Close Date is less than [UTCNow +0])”
Power Platform Business Rules Condition
Step 6: Add Error Message to your Business Rule
The business rule Action is where the rubber hits the road.
For our example, we are going to use an error message Action which will be displayed to the user.
This way, the user has to fix the Est. Close Date prior to leaving the record.
Our Show Error Message Action will have the following values:
Display Name: Est. Close Error Message
Entity: Opportunity
Error Message (Field): Est. Close Date
Error Message (Text): “Estimated Close Date is in the Past”
If everything was set correctly on your Action, the Action should look similar to the image below:
Power Apps Business Rule - Show Error Message
Step 7: Save and Activate your Business Rule
We are just finishing things up now. If you have completed the steps above, then you should “Save” the business rule and make sure you “Activate” it from the menu.
Once you get back to your solution, make sure that you “Publish all Customizations” for your solution.
The last step will be to test out your business rule. To do this just open the Opportunity in Dynamics CRM and look for the Est. Close Date.
If your date value is in the past, note the error message that you created with a business rule is displayed.
Dynamics CRM Business Rule validates Est. Close Date Business Rules are a no-code way of automating your form behavior. This step-by-step tutorial showed a very simple but useful example of how a business rule can help guide users to keep the system data up to date.
More complex business rules can be built to display recommendations, lock/unlock fields, set field values, show/hide fields and more.
We offer an easy way to start automating your workflows. Check out our unique approach to support & maintenance - you will love our Optrua Care Plans.
Extend your team with Optrua CRM experts
Business rules are extremely useful when optimizing your CRM system to improve data quality and enhance business outcomes. If you would like some help with new business rules for your business, Contact Us.
Comentários