"No Soup for You" The 5 Levels of Error Messages for Salesforce Validation Rules.
Recently, I had the opportunity to review a validation rule created by a Member of the Talent Stacker Career development program. While the user was prevented from saving a record with an error message displayed on the screen, I realized that there were some common pitfalls that new administrators may encounter when creating error messages.
I want to share some tips that can help you improve your error messaging, no matter your level of experience. Whether you're a newly minted admin or a seasoned pro, creating effective error messages is an ongoing process that requires attention to detail and a willingness to learn.
So, in this article, I'll be sharing some tips based on my experience as an admin for the last 8 years to help you level up your next validation rule error message. Let's dive in and make error messages more informative and helpful for all Salesforce users.
As a Salesforce Administrator, it's important to create effective validation rules that prevent users from saving incorrect or incomplete data. However, it's equally important to ensure that the error messages displayed to the end user are informative, clear, and provide a path forward to complete the task of saving the record. Here are the 5 levels of validation rule error messaging that can serve as a guide for evaluating the quality of your error messages:
I have deployed variations of all levels to my production orgs over the years. Some of them remain to this day because, technically, they function as intended even if they are not ideal.
Level 1: Contact your Salesforce Administrator, keeper of all the keys, the all-powerful wizard that can save records.
This level of error messaging is like a rude store employee who refuses to help you and tells you to "talk to the manager" without any explanation or assistance. It's frustrating for the end user as they don't know what the problem is or how to resolve it, and they are left feeling like they've hit a dead end. I would advise against using this level of error messaging as it doesn't provide any value to the end user. Besides, save yourself from endless emails from users hitting the message and now asking for your help. We're admins, not workaholics.
No soup for you.
This error message is like the Deli character from Seinfeld who refuses to serve soup to anyone who doesn't follow his strict rules. It doesn't provide any explanation or assistance to the end user and simply tells them they can't save the record.
Level 2: Errors that mean nothing to the end user.
This level of error messaging is like a cryptic message from a secret society. For example, ER-3579 or any numbered error that doesn't make any sense to the end user and leaves them scratching their head wondering what they did wrong. I would recommend avoiding this level of error messaging as it's not helpful or informative for the end user. ProTip: you can combine a numbered error system for your development team as long as you include some of level 5 as well. This can help triage screenshots from users in the future.
No Soup for you. $&*%^# (words uttered in a language the user does not know)
Remember users are prevented from saving the record. It's already painful enough. We don't want to swear at them with technical words they don't understand. ER-2579 user does not have access to a class that the Aura component leverages. While it might mean something to the development team is of low value to the user. Our team has discussed but not yet implemented distinguishing which validation rules are for data quality and which are for critical integrations. There may appear in our future a shorthand code prior to the error message for the user. For example: "DQ-14 User has insulted the staff before placing their order. Remove the value in insult__c in order to continue". If only it were that easy.
Level 3: Clearly explain the problem, provides zero path forward
At this level, the error message clearly explains the problem but doesn't provide any guidance or instructions on how to resolve it. It's like a doctor telling you that you have a condition but not giving you any medication or treatment plan to cure it. I would suggest providing some form of guidance or instruction on how to resolve the error, even if it's just a simple link to a help article or knowledge base. Ever take a lot of tests at the doctor only to receive a $1,200 bill and no diagnosis. Don't be that admin, users would rather have a witch doctor than an expensive bill for the development time.
领英推荐
Sample Error Message: The chef does not like you
Okay, now what? There is nothing this user can do to get their soup and the line behind them is concerned about the delay. The almost helpful error message is not helpful.
Level 4: Defines the error AND includes instructions to resolve
This level of error messaging defines the error and provides clear instructions on how to resolve it. It's like a GPS system that not only tells you where you went wrong but also provides turn-by-turn directions to get you back on track. I recommend using this level of error messaging as it's informative, helpful, and empowers the end user to resolve the error on their own. Leverage teammates to draft these. Do not rely on your own understanding of the business process, terminology, and technical solution. Consult with your Business Analyst, Product Owner, and even a UX designer if you have one on your team. When the problem exists on this object/page, then leverage the setting, and display error on the field instead of the top of the page which confuses users.
No soup for you, customer has been rude to the chef. Ask to speak to a manager
This is a valid error message. It explains what the user did wrong. However, it does not empower the user to resolve it. A trained user might be able to figure it out but the message alone does not help them do that. Moreover, user access and settings might prevent the user from navigating to another record to resolve it there. Be wary of a business process that requires hand-off to another team for the resolution of validation rule errors. The save of this record is prevented until this is resolved and now you user must remember any other changes to the record or save them separately until this "manager" completes another step. Seriously, most users would leave this deli and go somewhere else.
Level 5: The user that sees the message has the ability to resolve the error and complete the task (save the record).
At this level, the error message not only defines the error and provides instructions on how to resolve it, but also enables the user to take action and resolve the error directly within the error message. It's like having a personal assistant who not only tells you what to do but also does it for you. I recommend using this level of error messaging as it's the most effective way to prevent frustration and errors in your Salesforce environment. This level sounds simple but can be complex to reach. Sometimes you have to deploy a lower-level solution to meet deadlines or inform users quickly while taking another version into the backlog to resolve underlying business processes. During the grooming of the user story with your teammates think about what will deliver value immediately and what will require significant effort to resolve. Let your product owner make the decision to partially solve the situation now with a level 4 validation rule error and put it on the backlog to resolve with a level 5 as soon as a new field can be created or another process reworked. We strive for these with every message but it is often an iterative process.
You must compliment the chef to proceed with your order.
This error message not only defines the error and provides instructions on how to resolve it but also enables the user to take action and resolve the error directly within the error message. I would place this message next to the field "Compliment__c" where the user can select from a list of successful compliments that have worked for customers in the past.
About the author: Justin Dux is a Sr. Salesforce Administrator for Be the Match. We save lives by matching unrelated donors to patients in need of cellular treatments. Text "TalentStacker" to 61474 to learn more. Justin is also a job interview preparation expert for Talent Stacker Career Development Program. Talent Stacker is the leading Salesforce professional training program where members have lifetime access to resources and insight from experienced admins, developers, business analysts and even AI.
Implementation Specialist @ Fast Slow Motion | Salesforce Certified Professional | Drinker of too much coffee | Author of silly sci-fi | Remote work evangelist
2 年Love this. I will absolutely dedicate myself henceforth to writing Level 5 error messages like a good admin... but in my head I will secretly be thinking "NO SOUP FOR YOU"! ??
Salesforce Administrator @ University of Michigan | Checkout my YouTube Channel - TrailblazingWithSushin
2 年Thank you Justin for taking the time to write in detail how we need to write the validation error message. Those examples will help us remember it