In Dynamics 365 CRM or Power Platform, updates in entity data by using service call /SDK which do changes in server side, then server-side business rules will fire i.e., business rules with scope Entity will fire. As a business scenario we are going to see updates in contact entity by invoking service call through Post Man Tool which invokes business rule with Entity Scope.
Login to the required Dynamics CRM/ Power Apps environment using URL make.powerapps.com by providing username and password and go to solutions as shown in the below figure.
After Step 1, select custom solution here select ContactCustomizations custom solution as shown in the below figure.
After Step 2, in ContactCustomizations custom solution open Contact Entity and then click on Business Rules tab and then Click on Add business rule as shown in the below figure.
After Step 3, Create a business rule with scope as Entity and name business rule with Show Business Required Fields in Contact And Set Visibility. Logic here is if the field Birthday have value, then field Vaccination becomes mandatory and Discount field will be shown save business rule and activate and then publish the solution as shown in the below figure.
After Step 4, create a record in contact entity in selected Dynamics CRM Environment with a service call using Post Man tool and prepare request json as per the below format
And once json is prepared, in Post Man tool open a new request tab and provide required authentication related to CRM Environment paste above json in request body with the selection of raw and format as JSON as shown in the below figure
After Step 5, before creation of record, open respective CRM Environment and verify the contact is not present in the list of contacts as shown in the below figure
After Step 6, go to step 5 and click on Send Button and once you receive response then a record gets created in the crm Environment as shown in the below figure
After Step 7, go to crm environment and select contact entity and see the results you should see newly created record with name James M as shown in the below figure
After Step 8, open newly created James M record and see Discount field not populated and Vaccination field is not business required as shown in the below figure
After Step 9, copy record id of James M contact record so that we can update this record using Post Man tool by providing Birthdate as shown in the below figure
After Step 10, open Post Man tool and prepare a new request to update contact record with a field using Patch Verb and prepare a request with respective json body for Birthday field using the below json
and click on Send button if everything works fine then record gets updated as shown in the below figure
After Step 11, navigate back to crm environment and open/ refresh James M record and see birthdate got populated and the respective business rule which was created in Step 4 fires and makes fields Vaccination as Business Required and Discount Field shows up in the form as shown in the below figure
- Please make sure you keep the required fields on Contact Form.
- Select fields for Actions as well as for Conditions without fail.
- Make sure to Activate Business Rule after save and give scope as.
- Publish all changes without fail. Entity
- Give name of conditions and Actions names in a meaningful way.
- Make sure to configure CRM Environment in Post Man tool to use for Create and Update operations.
- Take proper care to see json was well formed or not.
Conclusion: In this way any server-side operations happen in CRM, respective business rules with scope Entity gets fired.