Post on 12-Jun-2015
description
Formula MagicAdministrators
Bruce Coe: salesforce.comLori Sarsfield: salesforce.comMartha Seneta: EnerNOCFrank Loiseaux-Purcell: salesforce.com
Safe HarborSafe 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 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, 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 intellectual property and other litigation, risks associated with 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 ended January 31, 2010. This documents and others 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 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.
Formula Magic: Agenda
I. Introduction / Goals
II. Case Studies: Lori Sarsfield
III. Formula Essentials
IV. Guest Speaker: Martha Seneta, EnerNOC
V. Formula Methodology
VI. Case Studies: Frank Loiseaux-Purcell
VII. Wrap-up Q&A
Formula Magic: Goals
Demonstrate the power and flexibility of formulas
Examine advanced formula solutions in case studies
Discuss formula essentials and methodology
Distinguish formula solutions vs. Apex coding
Formula Magic: Key Takeaways
Learn new ways to automate your processes
Add to your formula knowledge arsenal
Simplify formula creation and maintenance
Learn ways to teach formulas to your co-admins
Make the system work for you!
Automation = Better Data + Less Work
Reduce / eliminate: Manual, redundant data entry
Loss of data integrity
Data errors
Increase / maximize: Usage efficiency
Data integrity
Availability of reliable data
Formula Magic: Bottom Line
Make the system work for you!
Lori Sarsfield
salesforce.com
Professional Services
Improve the User Productivity!
Samples of real world formulas:
To provide better reporting, filtering capabilities to users
To improve identification of new business opportunities
To enforce data entry standards
Owner Field Formulas
Have you ever needed access to additional record
owner attributes to:– Use with mail merge functionality?
– Display owner attributes on a detail record?
– Facilitate reporting, list views, and campaign segmentation?
Owner Field Formulas
Hey – why don’t I just formula fields to pull in owner attributes?!?!?– No “>” next to the owner field that provides access to related owner
attributes
“>” is present for non-owner id lookups
Owner Attributes Solution Example
Use apex and formula fields to easily solve– Step 1: Create a custom lookup field to the user object
– Step 2: Create a simple trigger upon insert of record or update
of Owner field to populate a custom user lookup field
– Step 3: Create formula fields for any field on user object based
on custom user lookup field
Owner Attributes Solution Example
Custom user lookup field allows cross object access
to all user fields!
Owner Attributes Solution Example
Pull in owner contact info to include in mail merges!
Use formulas to split out owner Role name into attributes that can use used in reports, list views, or campaign filtering criteria!
Facilitating Cross Sell/UpSell
Current view of products owned by a customer using a related list
Alternate Solution
Use roll up summary and image formula fields to display current
product ownership and opportunities for cross sell and upsell
Solution Details
Create roll up summary fields that COUNTS the number of product
records of certain types to the customer record
Solution Details
Create IMAGE formula fields to display a visual indicator for
product ownership and add these to the page– IMAGE( IF( Checking_Savings_RU__c >0, "/servlet/servlet.FileDownload?
file=01580000001KPi5",
"/servlet/servlet.FileDownload?file=01580000001KPiA"), "Product")
Id’s in formula reference check mark and “x” images saved in the
documents tab
REGEX Formula Function
What the heck is a “regular expression”?– A template for the format of text strings
– Think: Social Security Numbers, Zip Codes, Dates
Commonly used in salesforce validation rules to enforce the format
of text strings
*REGEX only available in SOME formula contexts (not formula fields)
Sample REGEX Application
Have you ever had a request to have date picker fields go back
more than one year?
Alternative Date Field Solution
Step 1: Create a custom text field for date entry & enforce use
help text for format assistance to user
Alternative Date Field Solution
Step 2: Create a validation rule with the REGEX function that
validates the format entered is valid:
You don’t need to be a developer to use these!– Samples found in online help & training
– Example above was copied from an internet site
Alternative Date Field Solution
This date entry is accepted:
But this one is not:
Take it one step further!
Create a workflow rule or use apex to copy this date
into a standard date field hidden “behind the scenes”
Converting to standard date field allows users to filter
information on the date easier in list views, reports, etc
Bruce Coe
salesforce.com
Premier Support
Bruce Coe – Other Activities
AYSO soccer referee
Little League umpire
Guitar in Beatles tribute bands
Formula Essentials
Essentials: Formula Fields
Small scripts
Display real-time result
Do NOT store any data
Essentials: Formula Fields
Always Read-ONLY
Can call other formula fields
Formula Fields calling other Formula Fields
Inherits the code of the referenced field, NOT the result.
That’s why… order doesn’t matter.
PROBLEM: Formula >5000 characters
SOLUTION: Wait & see!!...
Essentials: Formula Fields
Formula fields:
• NEVER store data
• NEVER in data exports
• NEVER in Global Search
• NEVER in Lead mapping
• NEVER show up in [New] or [Edit]
Formulas are NOT just in Formula Fields!!
Formulas are ALSO found in…
Validation Rules
Workflow Rules
Assignment Rules
Auto-Resonse Rules
Escalation Rules
Essentials: Validation Rules
Trigger on [Save]
Display RED error message
Prevent [Save] with invalid data
The “IF” is implied
Formula: True/False
THEN Show error
Essentials: Validation Rules
Essentials: Validation Rules
Automatic reminder to user
Enforces manual data correction
Essentials: Workflow Rules
Triggered on [Save]
Implied “IF”
Condition (True/False)
Implied “THEN” = Actions: Email
Task
Field Update
Outbound Message (API call)
Essentials: Workflow Rules
Pointers:
WF rules cannot call other WF rules
Cannot control order; so combine
Use TRUE in formula for ALWAYS
Essentials: Workflow Rules
HOT TIP: WF Field Updates can have complex logic
CASE( YEAR( due_date__c ),
2007, "INXS",
2008, "Foo- Fighters",
2009, "Black Crows",
2010, "Stevie Wonder",
"TBD” )
“…did not previously meet the rule criteria”
NOT record lifetime
[Edit] [Save]
Order of Execution
Browse to:
http://developer.force.com
Search: “order [execution]”
Formula Visibility to Other Data
Formulas CAN see:
Fields on the current record
Fields on parent or grandparent records (cross-object)
System information such as $Profile, $User
Formulas CANNOT see:
Other records in same object
Child records (use Rollup Summary Fields instead)
Unrelated objects
End ofFormula Essentials
Customer Speaker Martha Seneta
EnerNOC, Inc.
EnerNOC: Energy management services and applications
Who is EnerNOC?
• Founded in 2003 • HQ in Boston, MA
• ~200M USD revenue • Offices in Canada, UK, across US; continued international expansion
• NASDAQ ticker: ENOC • ~500 employees ( almost all SFDC users)
What does EnerNOC do?
DemandSMART Earn money by reducing energy use during emergencies and other critical periods.
EfficiencySMART Actively manage your energy consumption via advanced monitoring, new insights, and expert advice.
SupplySMART Let us demystify the complex workings of the energy markets—and help your business get the best rates and energy solution.
CarbonSMART Measure, manage, and report greenhouse gas emissions, and take actionable steps to reduce your facility's carbon emissions and energy costs.
What’s my role at EnerNOC?
Title: Application Systems Analyst
Systems I support: Salesforce.com, Service-
now.com, and Crystal Reports
Responsibilities: Development and support;
enhancement prioritization and approval; release
management; training and documentation
My other EnerNOC role . . .
How to track customer/prospect verticals?
What’s the problem?
Business need: How to tailor to certain verticals?• Success in selling
• Success in execution
Business issues– Why not just have people select the “Industry” value?
• Inaccuracies & inconsistencies
• Takes time
• Categorizations are too broad
– Why not just use the data vendor’s “Industry” value?• Categorizations are too narrow
So, what source should we use for verticals?
NAICS Code
– 6 digits, each with an increased level of granularity• As an example, consider NAICS Code 311330:
31 Manufacturing (Sector)
311 Food Manufacturing (Sub-sector)
3113 Sugar and Confectionery Product Manufacturing (Industry group)
31133 Confectionery Manufacturing from Purchased Chocolate (Industry)
How do we get the right level of detail?
The “3rd digit” of significance (sub-sector) seemed right
for us– Narrow enough to be meaningful
– Broad enough to facilitate reporting
This is where formulas come in!
Use a formula to map the code to a meaning
Looking good, right?
The formula’s too big!
Doh! . . . we hit compiled-size limits!
Breaking the formula into pieces
What if we split the formula across multiple fields?– It will pass compile-size tests if we break it into 3 fields
• “NAICS 3-Digit Industry 1-399”
• “NAICS 3-Digit Industry 400-549”
• “NAICS 3-Digit Industry 550-999”
– Only 1 of the 3 fields will return a meaningful value
How will this work?
We don’t want 3 more fields on page layout
Don’t want to have to include 3 fields in reports
Can we use a formula to combine the 3 fields?
Will this work?
Compiled-size limit strikes again!
Referenced formulas are included in compiled size
Workflow to the rescue!
Create final text field (not formula)
Workflow rule identifies changes to NAICS Code
Field update consolidates formula results into text field
Finally . . . we got what we wanted!
Industry is now displayed at the desired level of
granularity for all records with a NAICS Code value!
How to format “Phone” field in a way that will please everyone?
What’s the problem?
Business need: How to format phone field?– Used for one-click dials, automated dials, and de-duping
Business issue: Many different parties to satisfy
User group Requirement
Event notification system “Phone” and “Extension” in separate fields
US Sales – North America “Phone” and “Extension” in single field
US Sales – International International country codes included
International Sales International country codes excluded
Lead Gen No extensions, no formatting
Why not create separate Phone entry fields?
How would this work?– UK and US could enter their numbers in separate fields
• Including extensions
• Including or excluding country codes as needed
– Ops could enter numbers in a different field without extensions
– Lead Gen could enter numbers in another field with no
formatting
Sounds like we’d be defeating the purpose of CRM!– Need to maintain a single point for management of phone
number data
This is where formulas come in!
One field for data management, many fields for data
consumption– Let’s keep the out-of-the-box “Phone” field as our entry point
for phone number content, and display that content in different
ways using formula fields!
We can satisfy the event notification vendor . . .
Create a separate entry field to capture extension
Use validation to ensure that no extension is entered
into regular “Phone” field
We can satisfy US-based Sales team . . .
Create a formula field to display the “Phone” field and
the new “Phone Extension” field together
This enables one-click dialing from PDA
We can make it easy for US to dial int’l . . .
Use validation to ensure that international numbers are
always entered with country codes included
We can make it easy for int’l to dial locally . . .
Create a formula field that removes the country codes
This enables one-click dialing from PDA for local Sales
teams
. . . And we can make it easy to de-dup
Create a formula field
that removes commonly
used punctuation
marks, and displays
only the local portion of
a number (i.e., the
right-most 8 digits)
Mission accomplished!
One place to manage data, many different views
Each field can be exposed only where needed
“Phone” (OOB field) 011441603692000
“Phone Extension” 2044
“Phone and Extension” 011441603692000 x2044
“International Phone” 01603692000
“Phone Stripped” 03692000
A few points to consider
Leverage all your configuration options
By splitting a formula into smaller pieces and
utilizing workflow, we achieved a single field from
which to consume “translated” NAICS Codes –
without hitting compiled-size limits.
By using one formula (“Phone and Extension”)
within another (“International Phone”), we avoided
having to duplicate code to display data from both the
“Phone” and “Phone Extension” fields.
Keep data entry in as few fields as possible
For reporting and data entry purposes, try to keep a
single point of entry to capture the content of a field.
Use formulas to map that data content into different
views.
Expose each formula view in different places as
needed.
Configuration vs. coding
Examples we looked at could have been handled via
coding rather than configuration.
Coding can be easier to manage because logic is held
in one place . . .
. . . BUT, coding takes a lot longer to build and deploy --
Even more importantly, we want these rules to be
supportable by admins, not just by developers!
Formula Methodology
Formula Design Methodology – PURPOSE!!
Achieve Business Need
Complete your automation quickly
Minimize complexity
Streamline maintenance
Make components easy to understand
Formula Design Methodology – PROCESS!!
1. Discuss Business Need & possible solutions
2. Write requirements and proposed solution
3. Pseudo-code; i.e. plain English
4. Sandbox
5. START SMALL!! Build piece by piece
6. Check syntax along the way
7. [Insert Field] and [Insert Function]
8. Name, Description, and inline comments
Formula Suggestions & Pointers
Functions in Formulas
Take advantage of the help provided whenever you click
on a function name in the Functions list:
Syntax
Description
Return data type
Help & samples
Logical Operators
AND() function = && operator
OR() function = || operator
Suggestion: Use && and || for better readability and
easier trouble-shooting than AND() and OR()
Ex: AND( Closed, Won ) vs. Closed && Won
Picklist fields: Which functions?
Picklists work with these functions:
ISPICKVAL
TEXT
CASE
Key points: TEXT() allows any text function to work on picklist value
TEXT() allows cross-object picklist view dynamically
Picklist fields: Number values
“It looks like a number…”
PROBLEM: “Number” entries are NOT actual numbers
Actually just another picklist value
SOLUTION: Use VALUE( TEXT( Fld )) to get true number
Formula Field NULL Treatment Option
Key point:
For “NULL” or “BLANK” functions on formula fields,
select “Treat blank fields as zeroes”.
Date & Time Format and Functions
DateTime format: YYYY-MM-DDTHH:mm:SS.sssZ
Ex: Hour of Day = MID( CreateDate , 12 , 2 )
Key point:
Formulas see date/time in GMT only
Ex. Adjust for Eastern Time: ( CreateDate – (1/24 * 5) )
Use custom field $User.GMT_Adjustment_in_Hours__c
End ofFormula Methodology
Frank Loiseaux-Purcell
salesforce.com
Solutions Manager
Making complex simplea Tale of two use-cases
How to make complex processes simple
Problem– You have a complex approval process and as Account
Executive you would like visibility into who needs to approve
your contract
– During the approval process you would also like to know where
you are in the approval process
How to make complex processes simple
Solution is formula fields!
Red Flag = Not yet ApprovedOrange Flag = Waiting ApprovalGreen Flag = ApprovedNot Required = Not Required
How to make complex processes simple
How was it built?– Enhancement to Product object to include a flag “Inc in Order
Management”. Which ensures the contract goes through Order
Management approval.
– Workflow field updates to bring over the flag when added to an
opportunity
– Approval Processes defined (multiple to maximize through put
by doing as many of the approvals in parallel. Along with Field
updates which the formulas pickup on and display status
How was it built? Contract custom fields
How was it built?
How was it built? IMAGE function
How to use formula’s to modify forecasting?
Problem:– Your company does not want to forecast all products on an
opportunity.
– For example you sell software and professional services and
only want to forecast software sales not the professional
services.
How to use formula’s to modify forecasting
Solution formula fields on Product
Booking Value is the total of the software sales and the Renamed Amount Field. This is what flows into Forecasting
How to use formula’s to modify forecasting
Opportunity Information
Booking Value – Sum of all Total Price (This is the renamed Amount field)
Total Opportunity Value – Sum of all Total Sales Price (Calculated field to include all products)
Opportunity Product Information
Old Sales Price – Contains unit price of product only for those products included in the forecast (not
shown on the Opportunity Screen). This is the original SFDC Sales Price.
Total Price - Contains value for the products included in the forecast (Qty * Old Sales Price)
Custom Opportunity Product Information
Sales Price Unit price of product for all products
Total Sales Price Total sales price for product (Qty * Sales Price)
Total Contract Value Separate entry for network, managed services, and professional services to
contain the total contract value for the product.
Mini-Case Studies
HELP! Product Name for Opportunity
PROBLEM: I can’t I see Product Name in my Opportunity
Rollup Summary Fields?
REASON: Opportunity and Product are BOTH parent
objects to Opportunity Product; i.e. can’t see each other
SOLUTION: Make a WF rule on Opportunity Product
to copy Product Name to new Opportunity Product field
HELP! Set record types from Convert Lead
PROBLEM: How to set record type of new Account,
Contact, and Opportunity during Lead Conversion?
SOLUTION:- Hidden text fields on Acct/Contact/Oppty: "Lead Record Type“
- Hidden formula fields on Lead: "Lead Record Type - Account“ [Contact, Opportunity]
- Map the Lead formula field to each of those text fields
- WF rule on Acct/Contact/Oppty: When created, criteria: "Lead Record Type" (local
hidden field) <equals> “<GivenRecordType>"
- WF field update: set the Record Type field (Acct/Contact/Oppty) to whichever record
type should be set from Lead Record Type “<GivenRecordType>"
HELP! How to make Round Robin?
PROBLEM: Need to evenly and automatically distribute
Cases or Leads to owners using round robin approach
SOLUTION:
Create a Round Robin and use in Assignment Rules:
1. Create an Auto-number field
2. Create a formula field:
MOD( AutoNumber__c , <Number for Round Robin> )
HELP! Decimal Precision with Formulas
PROBLEM: Two formula fields each with 2 decimal places
appear to be equal but show as NOT equal.
REASON: The comparison ignores the 2-decimal display
and instead uses more decimal places.
SOLUTION: Use the following in the calling formula:
ROUND( FormulaField_N__c , 2 )
HELP! Automatic Customer Status Field
PROBLEM: How to show dynamically whether each
Account is a Customer yet or not?
SOLUTION:
1. Create a hidden Rollup Summary Field on Account to show
COUNT of child Closed/Won Opportunities
2. Create and show a formula field (Text) on Account to be called "Is
Customer" to show "Yes“/"Not yet" based on whether RSF >0
Formula Magic Wrap-up
Automation = Better Data + Less Work
Reduce / eliminate: Manual, redundant data entry
Loss of data integrity
Data errors
Increase / maximize: Usage efficiency
Data integrity
Availability of reliable data
Formula Magic: Key Takeaways
Learn new ways to automate your processes
Add to your formula knowledge arsenal
Simplify formula creation and maintenance
Learn ways to teach formulas to your co-admins
Make the system work for you!
So why call it “Formula MAGIC”?
Technical system administrators:
We know that formulas are not magic
They are a logical, linear set of conditions and actions
Formulas are not magic to me or you…
…but they are to your system users
and to your business.
Formula Magic
D I S C O V E R
Visit Customer Success Team at Campground
Discover
Training
Learning Paths
Experience
Product
Demos
Learn about Customer
Resources
the products, services and resources
Meet Success Experts
S U C C E S S
Find us at the Customer Success Team area of Salesforce.com Campground at Moscone North
Learn about how to win prizes including 10 iPads & more!
that help you achieve
How Could Dreamforce Be Better? Tell Us!
Log in to the Dreamforce app to submit
surveys for the sessions you attendedUse the
Dreamforce Mobile app to submit
surveysEvery session survey you submit is
a chance to win an iPod nano!
OR