I am quite a fan of not using code where possible and where practical. However, there is no point sacrificing code if the user experience makes the system unusable. CRM 2013/2015 gives us a few tools in our kitbag for avoiding using code without sacrificing experience. I thought I would explore them.
I am so pleased to see real-time workflows in CRM. In the old days, workflows could only run in the back end. The problem with this is while you could make them do lots of interesting things (Auto-numbering, Lead Assignment and Counters, for example), the user experience was sub-par. The main problem was that while the workflow did everything you wanted it to, the user did not know what was happening because it was all on the server and not on the form. This has now changed with real-time workflows.
Any workflow can be converted to run in real-time by deactivating it and hitting the ‘Convert to a real-time workflow’ button at the top of the form.
I made of use of real-time workflows in my address finder article. The experience in that case was, once the location was set, the other fields appeared updated on the save of the record. In other words, if you are looking for something which behaves in a similar way to the OnSave event, a real-time workflow gets us close.
- OnSave (saving of the form)
- OnLoad (when the form opens on the screen)
- OnChange (when the value in a field changes)
- TabStateChange (opening and closing of Tabs)
So we have covered off the first one. What about the others? For these we will need Business Rules.
Another new function for CRM 2013/2015, Business Rules allow us to configure form behaviours. I mentioned Business Rules in my updated Auto-Number post from last year. Business Rules are configured on the form and here is a simple one I set up to test the behaviour. In this case, when the Main Phone is populated, the value is copied to the Other Phone field.
When activated, it becomes clear Business Rules run on both the OnLoad event (on loading the form, if the Main Phone had a value and the Other Phone did not, the value was copied) and OnChange event (if I changed the Main Phone value and tabbed out of the field, it was immediately copied to the Other Phone field). Please note that, with Business Rules, synchronous plugins run first and then the Business Rules fire in the order they were activated (oldest to newest). Also, in 2015, Business Rules were changed to fire server side, not client side (as they did for 2013). This means if a value changes in the back end (via integration, for example) the rule will fire without the need for opening the record. From a user’s perspective, it still appears as if the rule is firing OnLoad and OnChange.
Tab State Changes and Other Stuff
If you are upgrading and have a system with lots of code, there is plenty of opportunity with the improved functionality of CRM 2013/2015 to remove some of that code and replace it with configuration (especially if it is breaking in going from CRM 2011). Similarly if, like me, your coding days are a bit of a distant memory, the new functionality gives you something to impress clients and potential clients with when showing off what is possible with CRM forms and making them user friendly. Try them out and see how easy it is to configure what used to be coded.