17
1

How to Update Lead or Contact When Activity Logged (Automation Hour)

Embed Size (px)

Citation preview

1

2

Watch the presentation or continue for the slides

Douglas C. Ayers

Senior Developer, GearsCRMSalesforce MVPNashville Developer Group Leader8 x Certified, pursuing Technical Architect

Blog: douglascayers.com Twitter: @douglascayers Code: github.com/douglascayers Videos: youtube.com/c/douglascayers Slides: slideshare.net/douglascayersLinkedIn: /in/douglasayers

4

Business Use Case

Lauren Boyle, Sales Ops Manager at Universal Containers, wants to make her reps more productive by automating manual steps the team has to make on every lead.

Lauren requests that when a sales rep logs an activity on a new lead, then update the lead's status from "Open" to "Working - Contacted".

Lauren asks you, her favorite #AwesomeAdmin, to help implement a solution.

5

Automation Options – Tools in your Toolbox

• Apex Trigger• Workflow Rules• Process Builder• Flow

6

Automation Options – Apex TriggerAlthough doable, this is more effort and investment than necessary

… and don’t forget

your unit tests!

(more code…)

7

Automation Options – Workflow RulesNot usable because cannot create cross-object field updates for Tasks

8

Automation Options – Process BuilderCan perform cross-object field updates related to Tasks

9

Automation Options – FlowCan perform field updates on nearly any object

10

A Tale of Two Solutions Solution 1 Solution 2 Use Process Builder Only Use Flow invoked by Process

Builder

11

How do Tasks Relate to Other Records? Tasks have two special fields, each are lookups to multiple objects: - Name (WhoId) - Related To (WhatId)

Can relate to custom objects that Allow

Activities

12

How do Tasks Relate to Other Records?

It is non-deterministic to who or what any given Task record would be related.

However, we can use the 3 characterobject key prefix of the ID to know.

13

Astro says, “Let’s get to the demo!”

14

A Tale of Two Solutions: Recap Solution 1 Solution 2 Use Process Builder Only Use Flow invoked by Process

Builder

Questions? Blog: douglascayers.com Twitter: @douglascayers Code: github.com/douglascayers Videos: youtube.com/c/douglascayers Slides: slideshare.net/douglascayersLinkedIn: /in/douglasayers

thank y u