SlideShare a Scribd company logo
2
Most read
3
Most read
5
Most read
INTRODUCTION TO SALESFORCE
VALIDATION RULES
Presented By:
Omprakash Saini
Validation rules verify that the data a user enters in a record meets the
standards you specify before the user can save the record. A validation rule can
contain a formula or expression that evaluates the data in one or more fields
and returns a value of “true” or “false”. Validation rules also include an error
message to display to the user when the rule returns a value of “true” due to an
invalid value.
WHAT IS A VALIDATION RULE:
.The user chooses to create a new record or edit an existing record.
.The user clicks save.
. All validation rules are verified.
.If all data is valid, the record is saved.
.If any data is invalid, the associated error message displays
without saving the record.
.The user makes the necessary changes and clicks save again
AFTER YOU HAVE DEFINED VALIDATION
RULES:-
1. Make fields conditionally required, depending on the
value of another field.
2.Ensure that numbers are within a specified range, such
as discount is less than 30%.
3. Enforce that date fields are the correct chronological
sequence, such as start date is before end date.
EXAMPLE USES:-
AND:-
Returns a TRUE response if all values are true, returns a
FALSE response if one or more values are false. Use this
as an alternative to the operator && (AND).
FORMULA FIELD EXAMPLE:
IF (and(price<1,quantity<1),"small", null)
This formula displays “small” if the price and quantity are less
than one. This field is blank if the asset has a price or quantity
greater than one.
WE CAN USE THESE DIFFERENT
FORMULAS TO DEFINE VALIDATION
RULES:-
ABS:-
Calculates the absolute value of a number. The absolute
value of a number is the number without its positive or
negative sign.
USE: ABS (number) and replace number with a merge field,
expression, or other numeric value that has the sign you
removed.
EXAMPLE: ABS(ExpectedRevenue) calculates the positive
value of the expected revenue amount regardless of whether
it is positive or negative.
CASE:-
Checks a given expression against a series of
If the expression is equal to a value, returns the
corresponding result. If it is not equal to any values, it
returns the else_result.
USE: CASE (Expression, value1, result1, value2,
result2,...,Else_result)
EXAMPLE: Days open for cases use this example of a
custom formula field called days open to display different
text depending on the number of days a case has been
open:
case(days_open__c, 3,"reassign", 2, "assign task",
"maintain")
CONTAINS:-
Compares two arguments of text and
TRUE if the first argument contains the second argument.
not, returns FALSE.
USE: CONTAINS(TEXT, compare_text)
EXAMPLE: IF(CONTAINS(product_type__c, "part"),
"parts","service")
This formula checks the content of a custom text field
named product_typeand returns “parts” for any product
with the word “part” in it. Otherwise, it returns“service.”
Note that the values are case sensitive.
IF:-
Determines if expressions are true or false. Returns
given value if true and another value if false.
USE: IF (logical_test, value_if_true, value_if_false)
EXAMPLE:IF(AND(payment_due_date__c < TODAY(),
payment_status__c="unpaid"), "PAYMENT OVERDUE",
null)
This formula determines if the payment due date is
and the payment status is “UNPAID.” If so, returns the
text “PAYMENT OVERDUE” and if not, leaves the field
blank.
NOT:-
Returns FALSE for TRUE and TRUE for
USE: NOT(LOGICAL) And replace logical With the
expression that you want evaluated.
EXAMPLE: IF(NOT(ISPICKVAL(STATUS, "CLOSED"))
ROUND(NOW()Createddate,0), null checks to see if
a variable is open and if so, calculates the number
days it has been open by subtracting the date and
time created from the current date and time. The
result is the number of days open rounded to zero
decimal places. If the variable is not open, this field
blank.
THANK YOU…

More Related Content

PPTX
Salesforce Service Cloud - An overview
PDF
Salesforce Sales Cloud: Best Practices to Win More Deals
PPTX
Salesforce Overview For Beginners/Students
PPTX
What Is Salesforce? | Salesforce Training - What Does Salesforce Do? | Salesf...
PDF
Salesforce crm projects
PPT
Psychosexual development
PPTX
Salesforce Marketing Cloud Training | Salesforce Training For Beginners - Mar...
PPT
Salesforce Tutorial for Beginners: Basic Salesforce Introduction
Salesforce Service Cloud - An overview
Salesforce Sales Cloud: Best Practices to Win More Deals
Salesforce Overview For Beginners/Students
What Is Salesforce? | Salesforce Training - What Does Salesforce Do? | Salesf...
Salesforce crm projects
Psychosexual development
Salesforce Marketing Cloud Training | Salesforce Training For Beginners - Mar...
Salesforce Tutorial for Beginners: Basic Salesforce Introduction

What's hot (20)

PPTX
Why Flow with Salesforce Flow
PDF
Automate All The Things with Flow
PPT
Salesforce Presentation
PPT
Oracle Fusion HCM Presentation
PDF
Secure Salesforce: External App Integrations
PDF
Flow in Salesforce
PPTX
Salesforce PPT.pptx
PPTX
Introduction to Apex for Developers
PPTX
Introduction to salesforce ppt
PPTX
Everything You Need To Know About Dynamic Forms, Christine Marshall
PPTX
Build Apps Visually with Lightning App Builder
PDF
Salesforce CPQ, Orders, Contracts, Amendments and Renewals
PDF
Setting up Security in Your Salesforce Instance
PDF
Introduction to the Salesforce Security Model
PPTX
Profiles and permission sets in salesforce
PDF
Metrics Worth Measuring: Align Business Goals to Salesforce Adoption
PPTX
Azure role based access control (rbac)
PPTX
Apex code (Salesforce)
PPT
Salesforce complete overview
PPTX
Salesforce Integration Pattern Overview
Why Flow with Salesforce Flow
Automate All The Things with Flow
Salesforce Presentation
Oracle Fusion HCM Presentation
Secure Salesforce: External App Integrations
Flow in Salesforce
Salesforce PPT.pptx
Introduction to Apex for Developers
Introduction to salesforce ppt
Everything You Need To Know About Dynamic Forms, Christine Marshall
Build Apps Visually with Lightning App Builder
Salesforce CPQ, Orders, Contracts, Amendments and Renewals
Setting up Security in Your Salesforce Instance
Introduction to the Salesforce Security Model
Profiles and permission sets in salesforce
Metrics Worth Measuring: Align Business Goals to Salesforce Adoption
Azure role based access control (rbac)
Apex code (Salesforce)
Salesforce complete overview
Salesforce Integration Pattern Overview
Ad

Similar to Introduction to Salesforce validation rules new (20)

PDF
Validation Rules
PDF
Manual for Troubleshooting Formulas & Functions in Excel
PDF
MS Excel 2010 tutorial 5
PDF
Commonly used excel formulas
PDF
Commonly used excel formulas
PPTX
Core Excel Functions for Financial Modeling.pptx
PPTX
Empowerment Technology Lesson 4
PDF
Assessing Model Performance - Beginner's Guide
DOCX
Week 3 Lecture 11 Regression Analysis Regression analy.docx
DOC
142500146 using-oracle-fast formula-for-payroll-calculations
PPT
Excel CH 02 Working with Formulas Functions.ppt
PPT
Report Group 4 Constants and Variables
PPT
Report Group 4 Constants and Variables(TLE)
PDF
[M3A3] Data Analysis and Interpretation Specialization
DOCX
BUS 308 Week 4 Lecture 3 Developing Relationships in Exc.docx
PPT
Project in TLE
PDF
Simple Spreadsheet Tips
PPTX
Conditional Statements in C.pptx
DOCX
REGRESSION ANALYSISPlease refer to chapter 3 of the textbook fo.docx
DOCX
Here are the 16 pricing elements in pricing procedure and description for each
Validation Rules
Manual for Troubleshooting Formulas & Functions in Excel
MS Excel 2010 tutorial 5
Commonly used excel formulas
Commonly used excel formulas
Core Excel Functions for Financial Modeling.pptx
Empowerment Technology Lesson 4
Assessing Model Performance - Beginner's Guide
Week 3 Lecture 11 Regression Analysis Regression analy.docx
142500146 using-oracle-fast formula-for-payroll-calculations
Excel CH 02 Working with Formulas Functions.ppt
Report Group 4 Constants and Variables
Report Group 4 Constants and Variables(TLE)
[M3A3] Data Analysis and Interpretation Specialization
BUS 308 Week 4 Lecture 3 Developing Relationships in Exc.docx
Project in TLE
Simple Spreadsheet Tips
Conditional Statements in C.pptx
REGRESSION ANALYSISPlease refer to chapter 3 of the textbook fo.docx
Here are the 16 pricing elements in pricing procedure and description for each
Ad

Introduction to Salesforce validation rules new

  • 1. INTRODUCTION TO SALESFORCE VALIDATION RULES Presented By: Omprakash Saini
  • 2. Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record. A validation rule can contain a formula or expression that evaluates the data in one or more fields and returns a value of “true” or “false”. Validation rules also include an error message to display to the user when the rule returns a value of “true” due to an invalid value. WHAT IS A VALIDATION RULE:
  • 3. .The user chooses to create a new record or edit an existing record. .The user clicks save. . All validation rules are verified. .If all data is valid, the record is saved. .If any data is invalid, the associated error message displays without saving the record. .The user makes the necessary changes and clicks save again AFTER YOU HAVE DEFINED VALIDATION RULES:-
  • 4. 1. Make fields conditionally required, depending on the value of another field. 2.Ensure that numbers are within a specified range, such as discount is less than 30%. 3. Enforce that date fields are the correct chronological sequence, such as start date is before end date. EXAMPLE USES:-
  • 5. AND:- Returns a TRUE response if all values are true, returns a FALSE response if one or more values are false. Use this as an alternative to the operator && (AND). FORMULA FIELD EXAMPLE: IF (and(price<1,quantity<1),"small", null) This formula displays “small” if the price and quantity are less than one. This field is blank if the asset has a price or quantity greater than one. WE CAN USE THESE DIFFERENT FORMULAS TO DEFINE VALIDATION RULES:-
  • 6. ABS:- Calculates the absolute value of a number. The absolute value of a number is the number without its positive or negative sign. USE: ABS (number) and replace number with a merge field, expression, or other numeric value that has the sign you removed. EXAMPLE: ABS(ExpectedRevenue) calculates the positive value of the expected revenue amount regardless of whether it is positive or negative.
  • 7. CASE:- Checks a given expression against a series of If the expression is equal to a value, returns the corresponding result. If it is not equal to any values, it returns the else_result. USE: CASE (Expression, value1, result1, value2, result2,...,Else_result) EXAMPLE: Days open for cases use this example of a custom formula field called days open to display different text depending on the number of days a case has been open: case(days_open__c, 3,"reassign", 2, "assign task", "maintain")
  • 8. CONTAINS:- Compares two arguments of text and TRUE if the first argument contains the second argument. not, returns FALSE. USE: CONTAINS(TEXT, compare_text) EXAMPLE: IF(CONTAINS(product_type__c, "part"), "parts","service") This formula checks the content of a custom text field named product_typeand returns “parts” for any product with the word “part” in it. Otherwise, it returns“service.” Note that the values are case sensitive.
  • 9. IF:- Determines if expressions are true or false. Returns given value if true and another value if false. USE: IF (logical_test, value_if_true, value_if_false) EXAMPLE:IF(AND(payment_due_date__c < TODAY(), payment_status__c="unpaid"), "PAYMENT OVERDUE", null) This formula determines if the payment due date is and the payment status is “UNPAID.” If so, returns the text “PAYMENT OVERDUE” and if not, leaves the field blank.
  • 10. NOT:- Returns FALSE for TRUE and TRUE for USE: NOT(LOGICAL) And replace logical With the expression that you want evaluated. EXAMPLE: IF(NOT(ISPICKVAL(STATUS, "CLOSED")) ROUND(NOW()Createddate,0), null checks to see if a variable is open and if so, calculates the number days it has been open by subtracting the date and time created from the current date and time. The result is the number of days open rounded to zero decimal places. If the variable is not open, this field blank.