Dreamfoce 2013 Formula Ninjas

47
Formula Ninjas Deepa Patel, Halak Consulting, LLC, President @halakconsulting Steve Molis, Epsilon, Salesforce Administrator @stevemorforce Francisc Pindar, Radnip, Technical Consultant @radnip

Transcript of Dreamfoce 2013 Formula Ninjas

Page 1: Dreamfoce 2013 Formula Ninjas

Formula Ninjas Deepa Patel, Halak Consulting, LLC, President @halakconsulting Steve Molis, Epsilon, Salesforce Administrator @stevemorforce Francisc Pindar, Radnip, Technical Consultant @radnip

Page 2: Dreamfoce 2013 Formula Ninjas

Safe harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.

Page 3: Dreamfoce 2013 Formula Ninjas
Page 4: Dreamfoce 2013 Formula Ninjas

Deepa Patel Halak Consulting, LLC

@halakconsulting

Page 5: Dreamfoce 2013 Formula Ninjas

All about Halak Consulting, LLC

Halak Consulting LLC a Salesforce partner. We help firms identify problem areas and propose solutions that meet the firm’s requirements.

We work with clients to define their business goals, analyze current business infrastructure and identify nonexistent business processes.

We focus only on Salesforce.com software services

Silicon Valley User group co-leader, run Process & Strategy and Salesforce Certification Study Group on Success Community

Visit Us – www.halakconsulting.com

www.linkedin.com/in/deepapatelhalakconsulting/

Page 6: Dreamfoce 2013 Formula Ninjas

Formula Ninjas - Basics

Traditional Formula Writing

Compared to

Writing Formulas in Salesforce

Presenter
Presentation Notes
Today we are going to lake at Traditional Formulas and how they compare with Formulas in Salesforce. This is what most people struggle with. We will start with the basics and build on it. In the end we will show you how you can use a formula and apply it to monitor a business process. I have color coded the formulas to differentiate Traditional formula writing from Salesforce language.
Page 7: Dreamfoce 2013 Formula Ninjas

Formula Ninjas - Basics

In Salesforce world: IF( field = "Value", then do this, else do that) Comma is use in place of “THEN” and “ELSE”. Right parenthesis is used in place of “END IF”.

Simple If Formula Statement

If Apple = then Good to Eat ELSE Not Good to Eat END IF

Traditional Formula: Salesforce Formula:

IF (Apple = "Red", "Good to Eat", "Not Good to Eat")

Presenter
Presentation Notes
Lets look at a basic “IF” statement. In the traditional formula you will write If (this field) = “some value” then do this ELSE do that END IF In Salesforce world, the “IF” statements do start with a IF, but there are no “THEN”, “ELSE” or “END IF” statements. The Then and Else statements are implied by a “comma” and the END IF statement is implied by a “Close Parenthesis”.
Page 8: Dreamfoce 2013 Formula Ninjas

Formula Ninjas - Basics What do you do if you have nested if statements

IF Apple = then Sour ELSE If Apple = then Semi Sweet ELSE If Apple = then Delicious ELSE Rotten END IF END IF END IF

Traditional Formula: Salesforce Formula:

If( Apple = "Green", "Sour"), If (Apple = "Yellow", "Semi Sweet"), If (Apple = "Red", "Delicious"), "Rotten" ) ) )

Presenter
Presentation Notes
What do you do if you have nested IF Statements? In the Traditional Formula writing, we use the If criteria is True then do something, Else If Criteria is True then do next….so on until you are done with your comparison and end with corresponding END IF statements. In Salesforce world, we replace “THEN” with a comma and there is no Else statement. We nest the If statements with the next criteria until we have accounted for all criteria and then build the final “ELSE” result at the end the last “IF” statement with a comma and end the formula with right parenthesis matching the number of If statements.
Page 9: Dreamfoce 2013 Formula Ninjas

Formula Ninjas - Basics Now what if we want to use “AND” in our formula

IF Apple = AND Apple = Good to Eat ELSE Not Good to Eat END IF

Traditional Formula: Salesforce Formula:

IF( AND(Apple = "Yellow", Apple = "Red"), "Good to Eat", "Not Good to Eat" ) OR IF( (Apple = "Yellow" && Apple = "Red"), "Good to Eat", "Not Good to Eat" )

Salesforce World: AND(value 1, value 2, value 3....) (value 1 && value 2 && value 3...)

Presenter
Presentation Notes
Now what if we want to use the “AND” criteria in our formula? In the Traditional Formula writing, we use “AND” in between comparisons, and then place the then action. In Salesforce world, we use the word “AND” first and then do the comparisons of the values separated by commas. So if we had three values to compare, we would start with AND (value 1, value 2, value 3) and then place the action and else action. If you want to use the comparison more closer to the traditional formula writing, you can use the “&&” parameter so the logic becomes a little more simple.
Page 10: Dreamfoce 2013 Formula Ninjas

Formula Ninjas - Basics Same applies to the “OR” criteria Traditional Formula:

Salesforce World: OR(value 1, value 2, value 3....) (value 1 || value 2 || value 3...)

IF Apple = OR Apple = Good to Eat = “Yes" ELSE Good to Eat = “No" END IF

Salesforce Formula:

IF( OR(Apple = "Yellow", Apple = "Red"), "Good to Eat", "Not Good to Eat" ) OR IF( (Apple = "Yellow" || Apple = "Red"), "Good to Eat", "Not Good to Eat" )

Presenter
Presentation Notes
Same applies to the “OR” criteria. In the Traditional Formula writing, we use “OR” in between comparisons, and then place the then action. In Salesforce world, we use the word “OR” first and then do the comparisons of the values separated by commas. So if we had three values to compare, we would start with OR (value 1, value 2, value 3) and then place the action and else action. If you want to use the comparison more closer to the traditional formula writing, you can use the “||” parameter so the logic becomes a little more simple.
Page 11: Dreamfoce 2013 Formula Ninjas

Formula Ninjas - Basics

IF Picklist value is "Closed/Won" OR "Closed/Lost" AND Marketing Qualified Date is not blank, then Calculate Close Date - Marketing Qualified Date

Now lets combine the "AND" & "OR" parameters

IF (StageName = "Closed/Won" OR StageName = "Closed/Lost") AND Marketing Qualified Date <> Blank then Days to Close = Closed Date - Marketing Qualified Date ELSE Days to Close = 0 End IF

Traditional Formula:

Presenter
Presentation Notes
Just like we have a stage duration for Opportunities, we can build stage duration for Leads. In our example here we are transferring the Marketing Qualified Date to the Opportunity when we convert the lead. We now want to calculate how long did it truly take to close this business from we first touched this lead to when we closed the deal or lost the deal. So here we need to check for the opportunity stage for either Closed/Won OR Closed/Lost and make sure that the Marketing Qualified Date is not blank. Why are we checking this? If a lead has been manually entered into the system and did not get pushed through marketing the Marketing Qualified Date is going to be blank.
Page 12: Dreamfoce 2013 Formula Ninjas

Formula Ninjas - Basics Now lets combine the "AND" & "OR" parameters

IF( AND ( OR(ISPICKVAL(StageName, "Closed/Won"), ISPICKVAL(StageName, "Closed/Lost)), //Stage Field is a Picklist field NOT(ISBLANK(Marketing Qualified Date)) ), (CloseDate) - DATEVALUE(Marketing Qualified Date), // Marketing Qualified Date is a DateTime Field 0 )

Salesforce Formula:

Presenter
Presentation Notes
In the traditional world, we check for the OR function first and then use AND function. In Salesforce World we have to use the AND function first and within that we are building our OR criteria. In this example we are using some additional functions like “ISPICKVAL” for getting the values from a picklist and “DATEVALUE” to convert a date that is a datetime field to a regular date so that we can calculate the number of days between those two dates. We are also using the “ISBLANK” function to make sure that the date is not blank.
Page 13: Dreamfoce 2013 Formula Ninjas

Formula Ninjas - Basics Now lets combine the "AND" & "OR" parameters

OR – a little more easier to interpret IF( ((ISPICKVAL(StageName, "Closed/Won") || ISPICKVAL(StageName, "Closed/Lost)) && NOT(ISBLANK(Marketing Qualified Date))), (CloseDate) - DATEVALUE(Marketing Qualified Date), 0 )

Salesforce Formula:

Presenter
Presentation Notes
Here is the same formula a little easier. We are using the traditional logic with the “||” for the “OR” function and using “&&” for the “AND” function. We still have to use the ISPICKVAL and DATEVALUE functions. This just makes it easier to read.
Page 14: Dreamfoce 2013 Formula Ninjas

Formula Ninjas - Basics Lets look at two "AND" statements and two "OR" statements

IF (StageName = "Closed/Won" OR StageName = "Closed/Lost") AND (Unqualified Date = " " OR Marketing Qualified Date = " " ) then Calculate CloseDate - Created Date) End If

Traditional Formula:

Presenter
Presentation Notes
In this example we are checking to see if Marketing Qualified Date OR Unqualified Dates are blank AND stage is Closed/Won OR Closed/Lost then calculate the difference between the Closed Date and Created Date.
Page 15: Dreamfoce 2013 Formula Ninjas

Formula Ninjas - Basics Lets look at two "AND" statements and two "OR" statements

IF ( AND ( OR( ISPICKVAL( StageName , "Closed/Won"), ISPICKVAL( StageName , "Closed/Lost") ), OR ( ISBLANK( Unqualified Date ), ISBLANK( Marketing Qualified Date) ) ) , ( CloseDate) - DATEVALUE( CreatedDate), 0 )

Salesforce Formula:

Presenter
Presentation Notes
In Salesforce we compare the two “OR” statement. So the value check for the value of first OR statement and then compare that with the value of the second OR statement with the “AND” function. We have to start with the “AND” function here but, build the “OR” statements after we start with the “AND” function.
Page 16: Dreamfoce 2013 Formula Ninjas

Formula Ninjas - Basics Lets look at two "AND" statements and two "OR" statements

OR– a little more easier to interpret IF ( (ISPICKVAL( StageName , "Closed/Won") || ISPICKVAL( StageName , "Closed/Lost")) && (ISBLANK( Unqualified Date ) || ISBLANK( Marketing Qualified Date)), ( CloseDate) - DATEVALUE( CreatedDate), 0 )

Salesforce Formula:

Presenter
Presentation Notes
If we use the “||” and “&&” functions, we can use the logic we know and make it easier on ourselves.
Page 17: Dreamfoce 2013 Formula Ninjas

Formula Ninjas Business Case

Sales reps are supposed to follow up with their accounts at least once in 30 days. How can I see a score card that allows me to see at a glance which accounts have been followed up on?

Solution We built seven fields to build out this whole process: Follow up Interval Days – By default this will be 30 days Initial Follow up Date – Need this as this shows the deadline for when an account is first added Follow up Status Flag – This will hold our colorful flags for the score card. Account Last Activity Date – Inherit the system Last Activity Date Next Follow up Date – Shows the next deadline for follow up Days Since Last Activity – Calculates how long an account has not been followed up for Account Follow Up status – values in this field are used to populate the Follow Up Status Flag

We want to see a score card for all accounts that have not been followed up on for the last 30 days

Presenter
Presentation Notes
Why did I spend so much time explaining all this? I want to now show you how all of that can be applied to a fantastic business solution. In our case, management wants to see a score card for all accounts that have not been followed up for the last 30 days. How do we do this? We design a solution with seven fields. The description clearly shows what the fields are used for.
Page 18: Dreamfoce 2013 Formula Ninjas

Formula Ninjas Field Name Field Type Attribute Follow up Interval Days Number – Default 30 Read Only Initial Follow up Date Date Formula Follow up Status Text Formula Account Last Activity Date Date Formula Next Follow Up Date Date Formula Days Since Last Activity Number Formula Account Follow Up Status Text Formula - hidden

Presenter
Presentation Notes
Here is a list of all the fields with field type and their attributes
Page 19: Dreamfoce 2013 Formula Ninjas

Formula Ninjas Formulas

• Initial Follow Up Date – CreatedDate + Follow_up_Interval_Days__c • Days Since Last Activity - IF( ISBLANK( LastActivityDate), (TODAY() -

Initial_Follow_up_Date__c ), ( TODAY() - LastActivityDate) ) • Account Follow Up Status - IF( Days_Since_Last_Activity__c >

Follow_up_Interval_Days__c , "Red", "Green") • Follow Up Status - CASE( Account_Followup_Status__c ,

"Red", IMAGE ("/servlet/servlet.FileDownload?file=01550000000rzRO", "Red", 16,16), “Blue", IMAGE ("/servlet/servlet.FileDownload?file=01550000000rzRG", “Blue", 16,16), "")

• Account Last Activity Date – LastActivityDate • Next Follow Up Date - LastActivityDate + Follow_up_Interval_Days__c • Days Since Last Activity - IF( ISBLANK( LastActivityDate), (TODAY() -

Initial_Follow_up_Date__c ), ( TODAY() - LastActivityDate) )

Presenter
Presentation Notes
Here is the formula used to calculate those fields. Note the Follow Up Status field – We are using an image here to show the status based on the values from the Account Follow Up Status field. Note that for images we are supplying the image id for the value we want to show. Images are uploaded to the documents tab.
Page 20: Dreamfoce 2013 Formula Ninjas

Formula Ninjas TaDa!

Presenter
Presentation Notes
And this is our end result. We can clearly see which accounts have been followed up on and which have not. So what does the score card look like?
Page 21: Dreamfoce 2013 Formula Ninjas

Formula Ninjas TaDa!

Presenter
Presentation Notes
Add the Follow up Status field to the Account List View and you have your score card!
Page 22: Dreamfoce 2013 Formula Ninjas

Francis Pindar Radnip

@radnip

Page 23: Dreamfoce 2013 Formula Ninjas

All about Francis Pindar Solutions Architect with over 15 years in the web world. Now working on global Salesforce.com projects.

Founding member & architect of NCALT; eLearning service being used by over 120k British civil servants on a weekly basis.

My #DF13 Sessions today: – Salesforce Integration (Hilton 1pm-2pm) – Apex 10 Commandments (Moscone West 4pm – 4.45pm)

Spare time I work in film, theatre & TV and most recently producer for RENT in London. BAFTA nominated work on www.thelandofme.com

http://linkedin.com/in/francisuk/ or @radnip

Page 24: Dreamfoce 2013 Formula Ninjas

FORMULA FROM HELL

Page 25: Dreamfoce 2013 Formula Ninjas

Salesforce Enhanced Formula Editor

Presenter
Presentation Notes
IF( Finance_Written_Off__c = True, 'Written Off',IF(Finance_to_Credit_Opp__c = True, 'To Be Credited', IF( OR( AND(Finance_to_Invoice_Opp__c = True, ISBLANK(Date_to_be_Invoiced__c)) , AND(Finance_to_Invoice_Opp__c = True, Date_to_be_Invoiced__c <= TODAY())),'To Be Invoiced', IF( AND(CreatedBy.Alias = 'Website', !ISBLANK(Latest_Invoice__r.Website_Order_Id__c)), 'N/A', IF( Using_one_to_one_invoicing__c = 'Yes', IF( AND(Latest_Invoice__r.Is_Credited_In_Full__c = True,!ISBLANK(Latest_Invoice__c)) ,'Credited', IF(AND(Latest_Invoice__r.c2g__OutstandingValue__c = 0, !ISBLANK(Latest_Invoice__c)), 'Paid', IF(AND(Latest_Invoice__r.c2g__OutstandingValue__c > 0, Latest_Invoice__r.c2g__OutstandingValue__c < Latest_Invoice__r.c2g__InvoiceTotal__c), 'Part Paid',IF(AND(Latest_Invoice__r.c2g__OutstandingValue__c = Latest_Invoice__r.c2g__InvoiceTotal__c), 'Invoiced','No Action')))),'N/A')))))
Page 26: Dreamfoce 2013 Formula Ninjas

Installing Salesforce Enhanced Formula Editor

1. Load Google Chrome Browser 2. http://bit.ly/FormulaEditor 3. 4. Say thanks to Kyle Peterson (@kpeterson85)

Presenter
Presentation Notes
IF( Finance_Written_Off__c = True, 'Written Off', IF( Finance_to_Credit_Opp__c = True, 'To Be Credited', IF( OR( AND(Finance_to_Invoice_Opp__c = True, ISBLANK(Date_to_be_Invoiced__c)) , AND(Finance_to_Invoice_Opp__c = True, Date_to_be_Invoiced__c <= TODAY()) ), 'To Be Invoiced', IF( AND(CreatedBy.Alias = 'Website', !ISBLANK(Latest_Invoice__r.Website_Order_Id__c)), 'N/A', IF( Using_one_to_one_invoicing__c = 'Yes', IF( AND(Latest_Invoice__r.Is_Credited_In_Full__c = True,!ISBLANK(Latest_Invoice__c)) , 'Credited', IF( AND(Latest_Invoice__r.c2g__OutstandingValue__c = 0, !ISBLANK(Latest_Invoice__c)), 'Paid', IF( AND(Latest_Invoice__r.c2g__OutstandingValue__c > 0, Latest_Invoice__r.c2g__OutstandingValue__c < Latest_Invoice__r.c2g__InvoiceTotal__c), 'Part Paid', IF( AND(Latest_Invoice__r.c2g__OutstandingValue__c = Latest_Invoice__r.c2g__InvoiceTotal__c), 'Invoiced', 'No Action' ) ) ) ) ,'N/A' ) ) ) ) )
Page 27: Dreamfoce 2013 Formula Ninjas

DISTANCE() Formula Calculates the distance between two locations in miles or kilometers:

• Syntax: DISTANCE(mylocation1, mylocation2, “unit”)

• Examples: • DISTANCE(warehouse_location__c, store_location__c, “mi”)

• DISTANCE(warehouse_location__c, GEOLOCATION(37.775,-122.418), “km”)

Page 28: Dreamfoce 2013 Formula Ninjas

Using distance with user location

Page 29: Dreamfoce 2013 Formula Ninjas

Steve Molis Epsilon

@stevemoforce

Page 30: Dreamfoce 2013 Formula Ninjas

All about SteveMo

3 Time Salesforce MVP: 2011, 2012, 2013

Success Community: 1,700+ Best Answers

DeveloperForce: 400+ Solutions Authored

Pliny the Elder's owed: 2,100+

1 App named after me “Thanks Reid Carlberg!”

0 Salesforce Admin or Developer Certifications

Self-Taught Salesforce Administrator/Developer

Community College Drop-Out: 0.67 GPA * * Margin of error: +/- 0.67

Page 31: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat) *

• ISPICKVAL • CASE • TEXT

• ISBLANK • VALUE • BEGINS • CONTAINS

* No Animals Were Harmed in the Making of These Formulas

Presenter
Presentation Notes
Picklist Fields are great
Page 32: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat) *

Presenter
Presentation Notes
Best Practice Tip-1: Use the Insert Field, Insert Function, Insert Operator, Check Syntax buttons and the "Quick Tips" link. Trust me, they will not bite you. There's a rumor that an Admin did get attacked by the "Insert Selected Function" button once. But in fairness he was trying to use an ISPICKVAL function during Mating Season. And just use the Advanced Formula tab, honestly I dunno what the Simple Formula tab is there for. Maybe it's supposed to prevent some first-time Admin from falling off a Formula and hurting themselves like a set of training wheels or something… Co-Worker-1: Did you hear what happened to Dave? Co-Worker-2: No, what? Co-Worker-1: He tried to use a TODAY() function on a DateTime field and hit his head. Co-Worker-2: Holy crap! Is he okay? Co-Worker-1: Yeah, he's lucky it wasn't a Nested IF Statement or he mighta broken his friggin neck!
Page 33: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat) *

Function: ISPICKVAL (aka “old faithful”) Description: Determines if the value of a picklist field is

equal to a text literal you specify.

Example:

IF(ISPICKVAL(Weather, "Zombies!"), "RUN!!!", IF(ISPICKVAL(Weather, "HOT"), "Go Swimming", IF(ISPICKVAL(Weather, "WARM"), "Play Wiffle Ball", IF(ISPICKVAL(Weather, "COLD"), "Sit by the fire", "Send out for Pizza"))))

Function: CASE

Description: Checks a given expression against a series of values.

Example:

CASE(Weather, "Zombies!", "RUN!!!", "HOT", "Go Swimming", "WARM", "Play Wiffle Ball", "COLD", "Sit by the fire", "Send out for Pizza")

Presenter
Presentation Notes
ISPICKVAL vs. CASE ISPICKVAL = "Go outside and see if there are any Zombies out there" "Go outside and see if it's hot out" "Go outside and…" c CASE = "Go outside" "What's it like? Any Zombies out there? Is it hot? Anyone feel like pizza?"
Page 34: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat)

Function: TEXT Description: Converts picklist values to text in Validation Rules, Formula Fields, and Workflow Field Updates.

So you can do stuff like this…

Presenter
Presentation Notes
Function: TEXT Description: Converts a percent, number, date, date/time, or currency type field into text anywhere formulas are used. Also, converts picklist values to text in validation rules, formula fields, and field updates. Okay so Picklist values are really Text Strings… well, except other functions don’t see them that way. So you need to “convert” them from a Picklist value to a Text value using the TEXT function. Then you can do stuff like this…
Page 35: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat)

Problem: Make a custom picklist field called “Loss Reason” required if the Opportunity Stage is Closed/Lost.

Presenter
Presentation Notes
Function: ISBLANK Description: Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE.
Page 36: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat)

Solution: Create a Validation Rule Formula: AND( TEXT(StageName) = "Closed Lost", ISBLANK(TEXT(Loss_Reason__c)))

Presenter
Presentation Notes
Function: ISBLANK Description: Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE.
Page 37: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat)

Problem: Calculate the Opportunity Discount Amount from Discount% (a custom picklist field)

Presenter
Presentation Notes
Function: VALUE Description: Converts a text string to a number.
Page 38: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat)

Solution: Create a custom field Datatype: Formula Result: Currency Formula: Amount * ( VALUE( TEXT( Discount_Pct__c )) / 100)

Presenter
Presentation Notes
Function: VALUE Description: Converts a text string to a number.
Page 39: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat)

Tip: Create a custom Enhanced List View or Report to double-check your Formulas

Presenter
Presentation Notes
Best Practice Tip-2: Whenever you're creating a Formula Field create a List View or a Report that includes all of the fields your Formula is evaluating and your Formula Result side-by-side. Just because you didn't get a Syntax Error doesn't mean you didn't write a bad formula Or in the words of Winston Wolf from Pulp Fiction "Let's not start (patting each other on the back) just yet"
Page 40: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat)

Problem: Require priority 1-3 for any “Existing Customer” opportunities.

Presenter
Presentation Notes
Function: BEGINS Description: Determines if text begins with specific characters and returns TRUE if it does. Returns FALSE if it does not.
Page 41: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat)

Solution: Create a Validation Rule Formula: AND( BEGINS(TEXT(Type),"Existing"), VALUE(TEXT( Priority__c )) > 3))

Presenter
Presentation Notes
Function: BEGINS Description: Determines if text begins with specific characters and returns TRUE if it does. Returns FALSE if it does not. Function: VALUE Description: Converts a text string to a number.
Page 42: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat)

Problem: Do not allow “Renewal” Cases for Inactive Accounts

Presenter
Presentation Notes
Function: CONTAINS Description: Compares two arguments of text and returns TRUE if the first argument contains the second argument. If not, returns FALSE.
Page 43: Dreamfoce 2013 Formula Ninjas

> 1 way to deal with a Picklist field (or skin a cat)

Solution: Create a Validation Rule Formula: AND(Account.Active__c = FALSE, CONTAINS( TEXT(Status) , "Renewal"))

Presenter
Presentation Notes
Function: CONTAINS Description: Compares two arguments of text and returns TRUE if the first argument contains the second argument. If not, returns FALSE.
Page 44: Dreamfoce 2013 Formula Ninjas

Formula Ninjas Resources

• Introduction to Formulas - http://wiki.developerforce.com/page/An_Introduction_to_Formulas

• Formulas Quick Reference Guide - https://na13.salesforce.com/help/pdfs/en/salesforce_formulas_cheatsheet.pdf

• Useful Validation Rules - http://na13.salesforce.com/help/pdfs/en/salesforce_useful_validation_formulas.pdf

• Building a Cross Object Formula - https://help.salesforce.com/HTViewHelpDoc?id=fields_creating_cross_object_advanced.htm&language=en_US

Presenter
Presentation Notes
Here is the formula used to calculate those fields. Note the Follow Up Status field – We are using an image here to show the status based on the values from the Account Follow Up Status field.
Page 45: Dreamfoce 2013 Formula Ninjas

Deepa Patel

President @halakconsulting

Steve Molis Francis Pindar

Salesforce Administrator @SteveMoForce

Technical Consultant @radnip

Page 46: Dreamfoce 2013 Formula Ninjas

Do Not Forget!

Please fill out the Evaluation Forms

Page 47: Dreamfoce 2013 Formula Ninjas