1 of 60

Study Group

Platform App Builder

Business Logic and Process Automation - Part 1

Formula Fields, Roll up Summary Fields, Validation Rules, Approval Processes

Vickie Jeffery & Adrienne Cutcliffe

2 of 60

Thank You Sponsors

Platinum Sponsor

Bronze Sponsors

3 of 60

Vickie Jeffery

Head of Technology

Ausure

4 of 60

Adrienne Cutcliffe

Business Solutions Consultant

Traction on Demand

5 of 60

Agenda

  • Welcome�
  • Business Logic and Process Automation - Part 1

  • Questions

6 of 60

7 of 60

8 of 60

Want swag?

Tweet your certification pass

Mention @Archladies

Share your certification pass in our community group

9 of 60

Let’s Get Started

10 of 60

11 of 60

From the Exam Guide

12 of 60

Business Logic and Process Automation - Part 1

13 of 60

Formula Fields - What are they?

  • Custom field
  • Read only
  • Calculate a value
  • Other fields can be used in the calculation
  • Uses operators and functions to calculate
  • Have different return types
  • Automatically updated

14 of 60

Formula Fields - Limitations

  • Cannot search a formula field
  • Can’t be encrypted
  • Can’t use long text area or Description fields in a formula
  • Fields referenced in a formula field cannot be deleted
  • A field value cannot depend on another formula that references it
  • Up to 3900 characters including spaces
  • Cannot exceed 4000 bytes when saved

15 of 60

Formula Fields - Creating a Formula Field

  • Object Manager
  • Select object
  • Select Fields and Relationships
  • Click New
  • Select Formula
  • Enter a Field Label and Field Name (Field Name Defaults)
  • Select the Formula return type
  • If a number, currency or percent, select the Decimal places
  • Enter the formula.�

16 of 60

Creating a Formula Field

Formula Window

Description and Help Text

Formula Function Helper

Blank Handling

Check Syntax Button

17 of 60

Formula Fields - Return Types

Checkbox

Return a boolean value - True = Checked, False = Not Checked

Currency

Return as currency amount with currency denomination

Date

Return a date

Date/Time

Return a date/time

Number

Return a number, including decimals

Percent

Return a percent and adds a percent sign.

Text

Returns as a text string.

Time

Returns a time.

18 of 60

Formula Fields - Simple Formulas

  • The Simple Formula tab allows for basic formulas using Operators and Merge Fields to be created.

19 of 60

Formula Fields - Formula Operators

Math Operators

Return Type (Integer)

+ (Add)

= Field1__c + 30

35

- (Subtract)

= Field1__c - 30

-25

* (Multiply)

= Field1__c * 30

150

/ (Divide)

= Field1__c / 30

0.16666667

^ (Exponentiation)

= Field1^4 =

625 (5 x 5 x 5 x 5)

() (Open Parenthesis and Close Parenthesis)

= (Field1__c - 2) * Field2__c

30

Field1__c = 5, Field2__c = 10

20 of 60

Formula Fields - Formula Operators

Logical Operators

Example

Return Type

Result

= and == (Equal)

Priority__c = ‘High’

Priority__c == ‘High’

Boolean

False

<> and != (Not Equal)

Priority__c <> ‘High’

Priority__c != ‘High’

Boolean

True

< (Less Than)

Field1__c < Field2__c

Boolean

True

<= (Less Than or Equal)

Field1__c <= 3

Boolean

False

>= (Greater Than or Equal)

Field1__c >= 3

Boolean

True

Priority__c = ‘Low’, Field1__c = 5, Field2__c = 10

21 of 60

Formula Fields - Formula Operators

Logical Operators

Example

Return Type

Result

&& (AND)

IF (Priority__c = ‘High’ && Field1__c < Field2__c, True, False)

IF(AND(Priority__c = ‘High’, Field1__c < Field2__c), True, False)

Boolean

False

|| (OR)

IF (Priority__c = ‘High’ || Field1__c < Field2__c, True, False)

IF(OR(Priority__c = ‘High’, Field1__c < Field2__c), True, False)

Boolean

False

Priority__c = ‘Low’, Field1__c = 5, Field2__c = 10

22 of 60

Formula Fields - Advanced Formulas

  • The Advanced Formula tab allows for more advanced formulas using functions.
  • Functions can be selected which will give a description and format.

23 of 60

Formula Fields - Error Checking

  • Use the Check Syntax button at the bottom of the formula window to check for errors
  • Error checking will also occur when you click Next.

24 of 60

Formula Fields - Cross Object Formulas

  • Reference fields on related parent objects

Display the Job Applicant name on an associated Review record.

25 of 60

Formula Fields - Functions

Date and Time Functions

ADDMONTHS

DATE

DATEVALUE

DATETIMEVALUE

DAY

HOUR

MILLISECOND

MINUTE

MONTH

NOW

SECOND

TIMENOW

TIMEVALUE

TODAY

WEEKDAY

YEAR

Logical Functions

AND

BLANKVALUE

CASE

IF

ISBLANK

ISCLONE

ISNEW

ISNULL

ISNUMBER

NOT

NULLVALUE

OR

PRIORVALUE

Math Functions

ABS

CEILING

DISTANCE

EXP

FLOOR

GEOLOCATION

LN

LOG

MAX

MCEILING

MFLOOR

MIN

MOD

ROUND

SQRT

Text Functions

BEGINS

BR

RIGHT

CASESAFEID

RPAD

CONTAINS

SUBSTITUTE

FIND

TEXT

GETSESSIONID

TRIM

HTMLENCODE

UPPER

HYPERLINK

URLENCODE

IMAGE

VALUE

INCLUDES

ISPICKVAL

JSENCODE

JSINHTMLENCODE

LEFT

LEN

LOWER

LPAD

MID

26 of 60

Formula Fields - Date and Time Functions

Return Type

Formula

Result

Number

Text

Number

Date

27 of 60

Formula Fields - Logical Functions

I

Return Type

Formula

Result

Checkbox

TRUE, FALSE

Text

Yes, No

Text

Image

28 of 60

Formula Fields - Math Functions

I

Return Type

Formula

Result

Currency

Number

Number

29 of 60

Formula Fields - Text Functions

Return Type

Formula

Result

Text

Text

Text

30 of 60

Rollup Summaries - What are they?

  • A roll-up summary field calculates values from related records, such as those in a related list.
  • You can create a roll-up summary field to display a value in a master record based on the values of fields in a detail record.
  • The detail record must be related to the master through a master-detail relationship.
  • The types of fields you can calculate in a roll-up summary field depend on the type of calculation. For example,
    • Number, currency, and percent fields are available when you select SUM as the roll-up type.
    • Number, currency, percent, date, and date/time fields are available when you select MIN or MAX as the roll-up type.

31 of 60

What are Rollup Summary Fields?

32 of 60

Types of Rollup Summary Fields

Type

Usage

COUNT

Totals the number of related records

SUM

​Totals the values in the field you select in the Field to Aggregate option. Only number, currency, and percent fields are available

MIN

Displays the lowest value of the field you select in the Field to Aggregate option for all directly related records. Only number, currency, percent, date, and date/time fields are available.

MAX

Displays the highest value of the field you select in the Field to Aggregate option for all directly related records. Only number, currency, percent, date, and date/time fields are available.

33 of 60

Example Rollup Summaries

Type

Usage

COUNT

  • Number of Opportunities related to an Account record

SUM

  • Total Amount of all Closed Won Opportunities related to an Account record

MIN

  • Date of the earliest Closed Won Opportunity related to an Account record (first deal ever closed)

MAX

  • Highest discount every provided on an Opportunity related to an Account record
  • Largest Deal ever won related to an Account record

34 of 60

Rollup Summary Considerations

  • Cannot change a Master-Detail relationship to a Lookup relationship if Rollup Summary fields are present on the detail side
  • Rollup Summaries are read-only and cannot manually be edited
  • Salesforce does not recalculate the value of Campaign roll-up summary fields when leads or contacts are deleted.
  • You can force a mass recalculation of rollups on the edit page of the roll-up summary field
  • You can’t use long text area, multi-select picklist, autonumber, system fields , cross-object formula, and lookup fields in the field column of roll-up summary filters.

35 of 60

Rollup Summary Considerations

  • If a roll-up summary field doesn’t contain cross-object field references or functions that derive values on the fly, such as NOW or TODAY, it can calculate the values of formula fields.
  • Changes to the value of a roll-up summary field can trigger assignment rules to run.
  • A roll-up summary field can trigger workflow rules and field validations. However, workflow rules and field validations do not fire when the following changes cause a mass recalculation of roll-up summary values:
    • Changing the roll-up summary definition (such as the object, function, or field being aggregated)
    • Changing the expression of a formula field referenced in a roll-up summary field
    • Replacing picklist values for picklist fields referenced in the roll-up summary filter
    • Changing picklist record type definitions
    • Changing currency conversion rates
    • Changing price book entries

36 of 60

Validation Rules - What are they?

  • Allow verification of data to meet required standards before a record is saved
  • Required standards = your companies standards
  • Use formulas with a result of True/False
  • Custom error messages can be added
  • Uses - data quality, data type and length, require field value

37 of 60

Creating and View Validation Rules

  • Object Manager
  • Object
  • Validation Rules

38 of 60

Anatomy of a Validation Rule - Part 1

Name

State

Error Condition Formula

Formula Functions

39 of 60

Anatomy of a Validation Rule - Part 2

  • Formula
  • Error message
  • Error Message placement
  • Active
  • Cloning
  • Order of execution

Error Message

Error Location

40 of 60

Failed Validation Rule Example

I

Top of Page

Field

41 of 60

Validation Rules - Limitations and Considerations

Order of Execution (after before triggers)

  1. Validation rules
  2. Assignment rules
  3. Auto-response rules
  4. Workflow rules
  5. Escalation rules
  • If one validation rule fails, all other validation rules will continue.
  • For lead conversion, Validation and Triggers for lead conversion need to be enabled.
  • Don’t run if using the Mass Transfer Tool.
  • Can’t be used with compound fields (e.g. Mailing Address)

42 of 60

Validation Rules - Scenario 1

43 of 60

Validation Rules - Scenario 2

44 of 60

Validation Rules - Scenario 3

45 of 60

Validation Rules - Scenario 4

46 of 60

Approval Processes - What are they?

  • Work like Workflow Rules
  • Helps automate the approval of records
  • Can submit to one, or many approvers
  • Can be submitted manually or using process automation

47 of 60

Approval Process - Limitations

  • If the approval is on the detail side of a master-detail relationship, the Owner field is not available
  • If pre-entry criteria is not met, a generic error is presented
  • Flows can delete records that are pending approvals
  • Packages can include Approvals with steps that reference related users or queues as approvers; users are not supported
  • Field updates that are executed as approval actions don’t trigger workflow rules or entitlement processes

48 of 60

Approval Process Jump Start Wizard

49 of 60

Approval Process Jump Start Wizard

50 of 60

Approval Process Standard Setup Wizard

51 of 60

Approval Process Standard Setup Wizard

52 of 60

Approval Process Standard Setup Wizard

53 of 60

Approval Process Standard Setup Wizard

54 of 60

Approval Process Standard Setup Wizard

55 of 60

Approval Process Standard Setup Wizard

56 of 60

Approval Processes in Process Builder

57 of 60

Approval Processes in Flows

58 of 60

Questions

59 of 60

Next Steps

60 of 60

Thank you