SlideShare uma empresa 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…

Mais conteúdo relacionado

Mais procurados

Salesforce Lightning Process builder
Salesforce Lightning Process builderSalesforce Lightning Process builder
Salesforce Lightning Process builderThinqloud
 
Introduction to the Salesforce Security Model
Introduction to the Salesforce Security ModelIntroduction to the Salesforce Security Model
Introduction to the Salesforce Security ModelSalesforce Developers
 
Oracle Purchasing ivas
Oracle Purchasing ivasOracle Purchasing ivas
Oracle Purchasing ivasAli Ibrahim
 
Two-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsTwo-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsSalesforce Developers
 
Oracle HRMS Payroll Table Overview
Oracle HRMS Payroll Table OverviewOracle HRMS Payroll Table Overview
Oracle HRMS Payroll Table OverviewChris Martin
 
Simplified appointment scheduling using lightning scheduler
Simplified appointment scheduling using lightning schedulerSimplified appointment scheduling using lightning scheduler
Simplified appointment scheduling using lightning schedulerKadharBashaJ
 
Getting started with Salesforce security
Getting started with Salesforce securityGetting started with Salesforce security
Getting started with Salesforce securitySalesforce Admins
 
Getting Started with Process Builder
Getting Started with Process BuilderGetting Started with Process Builder
Getting Started with Process BuilderSalesforce Admins
 
Oracle HRMS Accrual plan Setup
Oracle HRMS Accrual plan SetupOracle HRMS Accrual plan Setup
Oracle HRMS Accrual plan SetupFeras Ahmad
 
Oracle Personalization How To Restricting users from assigning items to diffe...
Oracle Personalization How To Restricting users from assigning items to diffe...Oracle Personalization How To Restricting users from assigning items to diffe...
Oracle Personalization How To Restricting users from assigning items to diffe...Ahmed Elshayeb
 
Absence management in oracle HRMS
Absence management in oracle HRMSAbsence management in oracle HRMS
Absence management in oracle HRMSRajiv reddy
 
Secure Salesforce: External App Integrations
Secure Salesforce: External App IntegrationsSecure Salesforce: External App Integrations
Secure Salesforce: External App IntegrationsSalesforce Developers
 
Oracle EBS Self service from A to Z
Oracle EBS Self service from A to ZOracle EBS Self service from A to Z
Oracle EBS Self service from A to ZFeras Ahmad
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce dataSalesforce Developers
 
Oracle Retro pay by element
Oracle Retro pay by elementOracle Retro pay by element
Oracle Retro pay by elementrunjithrocking
 
Data Management and Migration in Salesforce
Data Management and Migration in SalesforceData Management and Migration in Salesforce
Data Management and Migration in SalesforceSunil kumar
 
Oracle Time and Labor (OTL) Setup for Project
Oracle Time and Labor (OTL) Setup for ProjectOracle Time and Labor (OTL) Setup for Project
Oracle Time and Labor (OTL) Setup for Projectiavinashpatel
 

Mais procurados (20)

Data model in salesforce
Data model in salesforceData model in salesforce
Data model in salesforce
 
Salesforce Lightning Process builder
Salesforce Lightning Process builderSalesforce Lightning Process builder
Salesforce Lightning Process builder
 
Introduction to the Salesforce Security Model
Introduction to the Salesforce Security ModelIntroduction to the Salesforce Security Model
Introduction to the Salesforce Security Model
 
Oracle Purchasing ivas
Oracle Purchasing ivasOracle Purchasing ivas
Oracle Purchasing ivas
 
Two-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsTwo-Way Integration with Writable External Objects
Two-Way Integration with Writable External Objects
 
Introduction to Apex for Developers
Introduction to Apex for DevelopersIntroduction to Apex for Developers
Introduction to Apex for Developers
 
Oracle HRMS Payroll Table Overview
Oracle HRMS Payroll Table OverviewOracle HRMS Payroll Table Overview
Oracle HRMS Payroll Table Overview
 
Simplified appointment scheduling using lightning scheduler
Simplified appointment scheduling using lightning schedulerSimplified appointment scheduling using lightning scheduler
Simplified appointment scheduling using lightning scheduler
 
Getting started with Salesforce security
Getting started with Salesforce securityGetting started with Salesforce security
Getting started with Salesforce security
 
Getting Started with Process Builder
Getting Started with Process BuilderGetting Started with Process Builder
Getting Started with Process Builder
 
Oracle HRMS Accrual plan Setup
Oracle HRMS Accrual plan SetupOracle HRMS Accrual plan Setup
Oracle HRMS Accrual plan Setup
 
Workflow in Salesforce
Workflow in SalesforceWorkflow in Salesforce
Workflow in Salesforce
 
Oracle Personalization How To Restricting users from assigning items to diffe...
Oracle Personalization How To Restricting users from assigning items to diffe...Oracle Personalization How To Restricting users from assigning items to diffe...
Oracle Personalization How To Restricting users from assigning items to diffe...
 
Absence management in oracle HRMS
Absence management in oracle HRMSAbsence management in oracle HRMS
Absence management in oracle HRMS
 
Secure Salesforce: External App Integrations
Secure Salesforce: External App IntegrationsSecure Salesforce: External App Integrations
Secure Salesforce: External App Integrations
 
Oracle EBS Self service from A to Z
Oracle EBS Self service from A to ZOracle EBS Self service from A to Z
Oracle EBS Self service from A to Z
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
 
Oracle Retro pay by element
Oracle Retro pay by elementOracle Retro pay by element
Oracle Retro pay by element
 
Data Management and Migration in Salesforce
Data Management and Migration in SalesforceData Management and Migration in Salesforce
Data Management and Migration in Salesforce
 
Oracle Time and Labor (OTL) Setup for Project
Oracle Time and Labor (OTL) Setup for ProjectOracle Time and Labor (OTL) Setup for Project
Oracle Time and Labor (OTL) Setup for Project
 

Semelhante a Introduction to Salesforce validation rules new

Validation Rules
Validation RulesValidation Rules
Validation RulesAasimAbdul
 
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 ExcelChristopher Ward
 
Commonly used excel formulas
Commonly used excel formulasCommonly used excel formulas
Commonly used excel formulassaladi330
 
Commonly used excel formulas
Commonly used excel formulasCommonly used excel formulas
Commonly used excel formulassaladi330
 
Empowerment Technology Lesson 4
Empowerment Technology Lesson 4Empowerment Technology Lesson 4
Empowerment Technology Lesson 4alicelagajino
 
Assessing Model Performance - Beginner's Guide
Assessing Model Performance - Beginner's GuideAssessing Model Performance - Beginner's Guide
Assessing Model Performance - Beginner's GuideMegan Verbakel
 
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.docxcockekeshia
 
Report Group 4 Constants and Variables
Report Group 4 Constants and VariablesReport Group 4 Constants and Variables
Report Group 4 Constants and VariablesGenard Briane Ancero
 
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)Genard Briane Ancero
 
[M3A3] Data Analysis and Interpretation Specialization
[M3A3] Data Analysis and Interpretation Specialization [M3A3] Data Analysis and Interpretation Specialization
[M3A3] Data Analysis and Interpretation Specialization Andrea Rubio
 
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.docxShiraPrater50
 
Project in TLE
Project in TLEProject in TLE
Project in TLEPGT_13
 
Simple Spreadsheet Tips
Simple Spreadsheet TipsSimple Spreadsheet Tips
Simple Spreadsheet TipsInside Access
 
Conditional Statements in C.pptx
Conditional Statements in C.pptxConditional Statements in C.pptx
Conditional Statements in C.pptxDelnazBehal
 
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.docxdebishakespeare
 
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 eachvishalsap84
 
Decision table
Decision tableDecision table
Decision tableDMANIMALA
 
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 VarianceDatagaps Inc
 

Semelhante 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
 
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
 
Excel IF, IFs.ppt
Excel IF, IFs.pptExcel IF, IFs.ppt
Excel IF, IFs.ppt
 

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.