How force users to change Opportunity stages your way

Time to time we have some nice challenges to solve and this one is one of them. It perfectly shows whether you are really ready to be an architect or maybe whether you just know the differences about all the different tools we have in Salesforce.

The challenge was pretty simple – do NOT allow users to change opportunity stages as they want, use some kind of checkbox for automatic progress.

Solutions

The obvious solution is easy – either remove the Stage field from page layout or make is read only.

Sadly, that isn’t possible.

Solution two – use validation rule to block users to change the field and use Process Builder to update it based on our needs. Works, as long as we have some other field set in the same time, which will „turn off“ the validation rule and enable it again after setting what was needed. Not nice solution.

Solution three – use validation rule to block users to change the field (do I repeat myself?) and use WORKFLOW rule to update the value. Surprise, surprise, it is possible to set workflow rules to ignore validation rules, meaning they can do whatever you want.

Problem solved, customer is happy and you know one more thing to check before you migrate all your workflow rules into process builders, because they are the future. From Spring ’20 running the before-save flows might solve this problem as well and their complexity is about the same. Triggers are way to go as well, but that requires development, which is usually a no-no.

Leave a Reply