Validation rule examples for various use cases, like preventing offensive language in
questions, replies, ideas, and idea comments.
Required Editions
| Available in: both Salesforce Classic and Lightning Experience |
| Available in: Contact Manager, Group, Professional,
Enterprise, Performance, Unlimited, Developer, and
Database.com Editions
|
Preventing Offensive Language in Questions
| Field |
Value |
|
Description:
|
Prevents users from entering offensive language in the Title and
Description fields when asking a question.
|
|
Formula:
|
OR(CONTAINS(Title, 'darn'), CONTAINS(Body, 'darn'))
|
|
Error Message:
|
Question title or description contains offensive language. |
Preventing Offensive Language in Replies
| Field |
Value |
|
Description:
|
Prevents users from entering offensive language when replying to a question. |
|
Formula:
|
OR(CONTAINS(Body, 'darn'), CONTAINS(Body, 'dang'))
|
|
Error Message:
|
Reply contains offensive language. |
Preventing Offensive Language in Ideas
| Field |
Value |
|
Description:
|
Prevents users from entering offensive language in the Title and
Description fields when posting an idea.
|
|
Formula:
|
OR(CONTAINS(Title, 'darn'), CONTAINS(Body, 'darn'))
|
|
Error Message:
|
Idea title or description contains offensive language. |
Preventing Offensive Language in Idea Comments
| Field |
Value |
|
Description:
|
Prevents users from entering offensive language when posting a comment. |
|
Formula:
|
OR(CONTAINS(CommentBody , 'darn'), CONTAINS(CommentBody, 'dang'))
|
|
Error Message:
|
Comment contains offensive language. |