SlideShare una empresa de Scribd logo
1 de 11
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…

Más contenido relacionado

La actualidad más candente

Why Flow with Salesforce Flow
Why Flow with Salesforce FlowWhy Flow with Salesforce Flow
Why Flow with Salesforce Flow
Ajeet Singh
 

La actualidad más candente (20)

Lightning web components
Lightning web components Lightning web components
Lightning web components
 
Salesforce Presentation
Salesforce PresentationSalesforce Presentation
Salesforce Presentation
 
Reports and dashboards @salesforce
Reports and dashboards @salesforceReports and dashboards @salesforce
Reports and dashboards @salesforce
 
Data Management and Migration in Salesforce
Data Management and Migration in SalesforceData Management and Migration in Salesforce
Data Management and Migration in Salesforce
 
An introduction to Salesforce
An introduction to SalesforceAn introduction to Salesforce
An introduction to Salesforce
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
Salesforce Integration Pattern Overview
Salesforce Integration Pattern OverviewSalesforce Integration Pattern Overview
Salesforce Integration Pattern Overview
 
Relationships in Salesforce
Relationships in SalesforceRelationships in Salesforce
Relationships in Salesforce
 
Salesforce Integration Patterns
Salesforce Integration PatternsSalesforce Integration Patterns
Salesforce Integration Patterns
 
Apex Trigger Debugging: Solving the Hard Problems
Apex Trigger Debugging: Solving the Hard ProblemsApex Trigger Debugging: Solving the Hard Problems
Apex Trigger Debugging: Solving the Hard Problems
 
Profiles and permission sets
Profiles and permission setsProfiles and permission sets
Profiles and permission sets
 
Best Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdfBest Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdf
 
Why Flow with Salesforce Flow
Why Flow with Salesforce FlowWhy Flow with Salesforce Flow
Why Flow with Salesforce Flow
 
Profiles and permission sets in salesforce
Profiles and permission sets in salesforceProfiles and permission sets in salesforce
Profiles and permission sets in salesforce
 
Apex Testing Best Practices
Apex Testing Best PracticesApex Testing Best Practices
Apex Testing Best Practices
 
Salesforce administrator training presentation slides
Salesforce administrator training presentation slides Salesforce administrator training presentation slides
Salesforce administrator training presentation slides
 
Introduction to Salesforce Platform - Basic
Introduction to Salesforce Platform - BasicIntroduction to Salesforce Platform - Basic
Introduction to Salesforce Platform - Basic
 
Top Benefits of Salesforce in Business
Top Benefits of Salesforce in BusinessTop Benefits of Salesforce in Business
Top Benefits of Salesforce in Business
 
Understanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce PlatformUnderstanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce Platform
 

Similar a Introduction to Salesforce validation rules new

Manual for Troubleshooting Formulas & Functions in Excel
Manual for Troubleshooting Formulas & Functions in ExcelManual for Troubleshooting Formulas & Functions in Excel
Manual for Troubleshooting Formulas & Functions in Excel
Christopher Ward
 
Commonly used excel formulas
Commonly used excel formulasCommonly used excel formulas
Commonly used excel formulas
saladi330
 
Week 3 Lecture 11 Regression Analysis Regression analy.docx
Week 3 Lecture 11 Regression Analysis Regression analy.docxWeek 3 Lecture 11 Regression Analysis Regression analy.docx
Week 3 Lecture 11 Regression Analysis Regression analy.docx
cockekeshia
 
142500146 using-oracle-fast formula-for-payroll-calculations
142500146 using-oracle-fast formula-for-payroll-calculations142500146 using-oracle-fast formula-for-payroll-calculations
142500146 using-oracle-fast formula-for-payroll-calculations
uday reddy
 
BUS 308 Week 4 Lecture 3 Developing Relationships in Exc.docx
  BUS 308 Week 4 Lecture 3 Developing Relationships in Exc.docx  BUS 308 Week 4 Lecture 3 Developing Relationships in Exc.docx
BUS 308 Week 4 Lecture 3 Developing Relationships in Exc.docx
ShiraPrater50
 
Conditional Statements in C.pptx
Conditional Statements in C.pptxConditional Statements in C.pptx
Conditional Statements in C.pptx
DelnazBehal
 
REGRESSION ANALYSISPlease refer to chapter 3 of the textbook fo.docx
REGRESSION ANALYSISPlease refer to chapter 3 of  the textbook fo.docxREGRESSION ANALYSISPlease refer to chapter 3 of  the textbook fo.docx
REGRESSION ANALYSISPlease refer to chapter 3 of the textbook fo.docx
debishakespeare
 
Here are the 16 pricing elements in pricing procedure and description for each
Here are the 16 pricing elements in pricing procedure and description for eachHere are the 16 pricing elements in pricing procedure and description for each
Here are the 16 pricing elements in pricing procedure and description for each
vishalsap84
 
Decision table
Decision tableDecision table
Decision table
DMANIMALA
 

Similar a Introduction to Salesforce validation rules new (20)

Validation Rules
Validation RulesValidation Rules
Validation Rules
 
Manual for Troubleshooting Formulas & Functions in Excel
Manual for Troubleshooting Formulas & Functions in ExcelManual for Troubleshooting Formulas & Functions in Excel
Manual for Troubleshooting Formulas & Functions in Excel
 
MS Excel 2010 tutorial 5
MS Excel 2010 tutorial 5MS Excel 2010 tutorial 5
MS Excel 2010 tutorial 5
 
Commonly used excel formulas
Commonly used excel formulasCommonly used excel formulas
Commonly used excel formulas
 
Commonly used excel formulas
Commonly used excel formulasCommonly used excel formulas
Commonly used excel formulas
 
Empowerment Technology Lesson 4
Empowerment Technology Lesson 4Empowerment Technology Lesson 4
Empowerment Technology Lesson 4
 
Assessing Model Performance - Beginner's Guide
Assessing Model Performance - Beginner's GuideAssessing Model Performance - Beginner's Guide
Assessing Model Performance - Beginner's Guide
 
Week 3 Lecture 11 Regression Analysis Regression analy.docx
Week 3 Lecture 11 Regression Analysis Regression analy.docxWeek 3 Lecture 11 Regression Analysis Regression analy.docx
Week 3 Lecture 11 Regression Analysis Regression analy.docx
 
142500146 using-oracle-fast formula-for-payroll-calculations
142500146 using-oracle-fast formula-for-payroll-calculations142500146 using-oracle-fast formula-for-payroll-calculations
142500146 using-oracle-fast formula-for-payroll-calculations
 
Report Group 4 Constants and Variables
Report Group 4 Constants and VariablesReport Group 4 Constants and Variables
Report Group 4 Constants and Variables
 
Report Group 4 Constants and Variables(TLE)
Report Group 4 Constants and Variables(TLE)Report Group 4 Constants and Variables(TLE)
Report Group 4 Constants and Variables(TLE)
 
[M3A3] Data Analysis and Interpretation Specialization
[M3A3] Data Analysis and Interpretation Specialization [M3A3] Data Analysis and Interpretation Specialization
[M3A3] Data Analysis and Interpretation Specialization
 
BUS 308 Week 4 Lecture 3 Developing Relationships in Exc.docx
  BUS 308 Week 4 Lecture 3 Developing Relationships in Exc.docx  BUS 308 Week 4 Lecture 3 Developing Relationships in Exc.docx
BUS 308 Week 4 Lecture 3 Developing Relationships in Exc.docx
 
Project in TLE
Project in TLEProject in TLE
Project in TLE
 
Simple Spreadsheet Tips
Simple Spreadsheet TipsSimple Spreadsheet Tips
Simple Spreadsheet Tips
 
Conditional Statements in C.pptx
Conditional Statements in C.pptxConditional Statements in C.pptx
Conditional Statements in C.pptx
 
REGRESSION ANALYSISPlease refer to chapter 3 of the textbook fo.docx
REGRESSION ANALYSISPlease refer to chapter 3 of  the textbook fo.docxREGRESSION ANALYSISPlease refer to chapter 3 of  the textbook fo.docx
REGRESSION ANALYSISPlease refer to chapter 3 of the textbook fo.docx
 
Here are the 16 pricing elements in pricing procedure and description for each
Here are the 16 pricing elements in pricing procedure and description for eachHere are the 16 pricing elements in pricing procedure and description for each
Here are the 16 pricing elements in pricing procedure and description for each
 
Decision table
Decision tableDecision table
Decision table
 
ETL Validator Usecase - Validating Measures, Counts with Variance
ETL Validator Usecase - Validating Measures, Counts with VarianceETL Validator Usecase - Validating Measures, Counts with Variance
ETL Validator Usecase - Validating Measures, Counts with Variance
 

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.