SlideShare a Scribd company logo
2
Most read
3
Most read
4
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

PDF
Become a Formula Ninja
PDF
Formula Ninja at Dreamforce 2014
PDF
Salesforce interview-preparation-toolkit-formula-and-validation-rules-in-sale...
PDF
Sales force certification-lab
PDF
Salesforce interview preparation toolkit formula and validation rules in sale...
PDF
100 sample formulas_v6
PDF
Sales force certification-lab
PDF
Sales force class-3
Become a Formula Ninja
Formula Ninja at Dreamforce 2014
Salesforce interview-preparation-toolkit-formula-and-validation-rules-in-sale...
Sales force certification-lab
Salesforce interview preparation toolkit formula and validation rules in sale...
100 sample formulas_v6
Sales force certification-lab
Sales force class-3

Similar to Validation Rules (20)

PDF
Les formules et moi, ça fait 3!
PPT
A G S006 Little 091807
PDF
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
PDF
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
PDF
DF16 Imprivata - Getting Started with Formulas
PPTX
Business rulers in Microsoft Dynamics CRM 2013
PDF
Revving up the Force.com Formula Engine
PPT
Generic test cases guidelines
PPT
Generictestcasesguidelines 101201033527-phpapp01
PDF
Steve mo's formulas and life hacks frankfurt de 2020-05-07
PDF
DF2UFL 2012: Reporting & Dashboards with Formula Success Tools
PDF
Steve mo's formulas and life hacks wellington nz 2020-05-05
PDF
Salesforce Admin Hacks
PPTX
Become A Formula Writing Guru in 20 Minutes by Mike Martin & Shannon Howe
PDF
Comprehensive Guide in using Formulas for Marketo
PDF
SteveMo Webinar: Hit a Home Run with Formula & Analytics Tricks
PDF
Demystifying Code for Admins: The Last Step to Apex
PDF
After Pm Schedule Gen
PDF
Top 10 excel analytic tests to minimize fraud and process risks
PDF
Finit formula and business rule efficiency in one stream
Les formules et moi, ça fait 3!
A G S006 Little 091807
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
DF16 Imprivata - Getting Started with Formulas
Business rulers in Microsoft Dynamics CRM 2013
Revving up the Force.com Formula Engine
Generic test cases guidelines
Generictestcasesguidelines 101201033527-phpapp01
Steve mo's formulas and life hacks frankfurt de 2020-05-07
DF2UFL 2012: Reporting & Dashboards with Formula Success Tools
Steve mo's formulas and life hacks wellington nz 2020-05-05
Salesforce Admin Hacks
Become A Formula Writing Guru in 20 Minutes by Mike Martin & Shannon Howe
Comprehensive Guide in using Formulas for Marketo
SteveMo Webinar: Hit a Home Run with Formula & Analytics Tricks
Demystifying Code for Admins: The Last Step to Apex
After Pm Schedule Gen
Top 10 excel analytic tests to minimize fraud and process risks
Finit formula and business rule efficiency in one stream
Ad

Recently uploaded (20)

PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
PPT on Performance Review to get promotions
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Geodesy 1.pptx...............................................
PPTX
Sustainable Sites - Green Building Construction
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Digital Logic Computer Design lecture notes
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PDF
Well-logging-methods_new................
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
web development for engineering and engineering
Foundation to blockchain - A guide to Blockchain Tech
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPT on Performance Review to get promotions
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Geodesy 1.pptx...............................................
Sustainable Sites - Green Building Construction
UNIT-1 - COAL BASED THERMAL POWER PLANTS
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Digital Logic Computer Design lecture notes
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
Well-logging-methods_new................
bas. eng. economics group 4 presentation 1.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
UNIT 4 Total Quality Management .pptx
CYBER-CRIMES AND SECURITY A guide to understanding
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
web development for engineering and engineering
Ad

Validation Rules

  • 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.