Today, we'll walk users who are relatively new to Microsoft Dynamics 365 through some relatively simple data validation checks.
You may come across a scenario where you want to perform a simple verification on a field before you create a record. For example, you may wish to perform a validation to check if the registered Due Date on a record is older than the record's creation date. Often, validations are implemented with custom code. However, in situations where custom technical work may not be feasible, the solution outlined below can be implemented with ease.
Business rules are a potential answer here since a validation can be applied here by comparing the Due Date against the value within the standard 'Created On' field. However, this field will not be populated during creation of a record which means Dynamics 365 doesn't have a value to check against, rendering the sole use of business process flow alone futile.
A synchronous workflow on the other hand can be triggered to perform this validation before the record is created. The workflow can be stopped with the status of Cancelled if the required criteria is not met. Although this will solve the problem of validating the Due Date field before creating record, the business process error shown by the workflow is less user friendly than the error shown by the business rule.
Also, running synchronous workflows whenever the Due Date field is updated may result in significant processing load which is especially undesirable during peak periods. Therefore, limiting this workflow to only run prior to record creation is ideal while the business rule can be used for validation after record creation.
To conclude, the synchronous workflow and the business rule can be used in combination to overcome this issue. While the workflow will perform this validation effectively during record creation, the business rule will take over with a much more user-friendly error message once the record is created.
For more Dynamics 365 tips and tricks, be sure to keep checking our blog!
Happy Dynamics 365'ing!