I have a workflow that sends an email containing values from several fields. However, if the fields are blank or don't meet certain criteria, I want the workflow to stop, and most importantly, I want an alert to be displayed that lets the user know (preferably in real time) that the workflow is going to be canceled, and they should go back and correct those fields. To put it another way, I want conditional alerts, i.e., if certain conditions are present, I want to display an alert to the user. Ideas?
*This post is locked for comments
Thank you both for the suggestions. You gave me some good ideas that led to final solution: I used conditional statements in the workflow, so if the right conditions are not present, it will stop the workflow as canceled. I put a custom message into the cancellation properties so that when the workflow stops, CRM displays an alert which tells the user why it failed. I am using a real time workflow.
Franco,
If you are using CRM 2013 and above you can have Real Time workflow that can help you validate the process and cancel it if the fields are blank or don't meet certain criteria.
Making the field as mandatory might be a solution to you prompt user that should key in this field, but in some point this field is not necessary to set as mandatory, for example you have case: if Account industry is IT then you need to make sure that the salesperson key in the Number of Consultant, for example, by making it as mandatory.
If Account industry is Agriculture then the Number of Consultant field of course is not mandatory, instead, maybe you need another number like total size of field in hectare or who is their Farm Supplier, etc. And if Account industry is Food then you need Best Chef Name, for instance only.
So the conditions is can be various. Which you can use Business Rule or JavaScript as well.
But, if you already create your own process in the workflow, then you can utilize workflow for validation purpose.
Here are the useful example:
garethtuckercrm.com/.../crm-2013-new-features-using-real-time-workflow-for-validation-rules
It will help to prompt user based on certain conditions + cancel the workflow as well, meaning that not finishing the execution as completed.
But there are things you need to aware that the prompt only works for Real Time Workflow, otherwise it would only cancel the workflow without notification, and if you are not using CRM 2011 and above, you cannot have this feature, then it will only triggered in some condition after save, for example field change, created, etc based on workflow trigger point. And you cannot have condition based on child records.
Hope this helps.
Thank you.
Hi Franco,
Since you are talking about making fields mandatory, I would not suggest to make them using the OOB functionality.
You can make the fields Business Required. This will not allow the user to Save the record until those fields are entered.
You can also check the criteria for the fields using JScript and if the condition is not met you can alert the User to correct those fields.
Since Workflow has trigger point you can always stop them to hit by not Saving the record.
Hope that helps
Thanks
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,113 Super User 2024 Season 2
Martin Dráb 229,918 Most Valuable Professional
nmaenpaa 101,156