formula tips and tricks - third sector...
TRANSCRIPT
Goals of this Session
• You know what is possible with Formulas • You know where to look for more info
Just Like Excel…
• If you don’t know formulas already, you have a doubly steep learning curve
• In Excel, an example of formulas:
Where you find them
Formulas are not just created when you create a formula field. Formulas can be used (or required) for
• Formula Fields (most common) • Validation • Reporting • Buttons and Links
Formula Fields Overview
• Formulas ≠ Formula Fields • Formulas fields can manipulate dates,
numbers, currency, text, hyperlinks, and images
• Can be referenced by other formulas • Always have a lock icon on them on page
layout – you can never change them
Create a Formula Field
• Every object can have a formula field • To Create a traditional formula field
– Click on Setup > Customise > (the object) > Fields > New > Formula >
– Choose a name and type of formula – Write the formula – Choose Security and Layout options, & Save
URL’s & Custom Links
• Several already exist, such as Google Maps and Google News
• Create additional custom links, with standard and custom fields embedded in the URL
• Quick access to other web-based systems • Examples
– Charity Commission URL – Companies House URL
Create New Salesforce Records
• Salesforce URL has a clear structure. Can be written as formula for new record Button
• /006/e creates a new opportunity • /006/e?accid=001D000000pNlbZ • /006/e?accid=001D000000pNlbZ
&opp3={!Account.Name}%20Membership%20Payment &opp5=Membership&opp11=Closed%20Won
• Unsupported Feature, more info at http://salesforce.phollaio.com/2007/04/02/how_to_obtain_a_field_id/
Pretty Icons
• Salesforce icons are quick ways to graphically display information
• Image appears on Record Page, Views, Reports, etc
• Resources: – Salesforce Image Formula Guide:
http://www.salesforce.com/community/assets/docs/Sample_Image_Formula_Fields_Customization_Guide.pdf
– List of all natively available iconshttp://free-121d5f44d20-121d603d1c5-121ee2b8103.force.com/force2b/salesforceicons
– More icons! Free Graphics Pack on the App Exchangehttp://appexchange.salesforce.com/listingDetail?listingId=a0N30000004cfIcEAI
Pretty Pictures
• Link to Third Party Images, such as Yahoo Stock Chart
• Google Charts – Highly advanced, when you need to take
graphical information to the next level – Create initial URL with Google Chart Wizard – http://www.youtube.com/watch?v=wxWz1DKIRXk – From 36:00 to 53:45 – Example for demo – budgeted funds remaining
Roll-up Summaries
Roll-Up summaries aren’t exactly formulas, but they are similar, and are often used as the basis for other formulas
• They can Count, Sum, or determine the Min or Max of other objects
• Must be on a Master-Detail Relationship • Date fields only in Min/Max summaries
Bringing it all Together
• For a membership org, you might want to know: – Last Membership Payment Date (roll-up) – Membership Valid Until Date (date) – Days Left in Membership (number) – Lifetime Payment Total (roll-up) – Membership Valid Flag (image)
How to Experiment
• Don’t use your production org! • Create a sandbox – Non-profit orgs have 7
by default (Setup > Data Management > Sandbox), or
• Get a Developer org – use it forever, fully featured, limited to two users and a few thousand records, at http://developer.force.com
Appendix A
• Charity Commission & Companies House Lookups (custom field creation required)
– http://www.charity-commission.gov.uk/Showcharity/RegisterOfCharities/SearchResultHandler.aspx?RegisteredCharityNumber={!Account.Charity_No__c}
– http://data.companieshouse.gov.uk/doc/company/{!Account.Company_No__c} • Yahoo Finance Chart • This formula does not use custom fields, so you should be able to create a new
formula field on the Account object and paste the formula IF( ISBLANK(TickerSymbol),null, HYPERLINK( ("http://finance.yahoo.com/q?s=" & TickerSymbol ), IMAGE( "http://chart.finance.yahoo.com/c/1y/a/" & TickerSymbol , "Ticker Image") ) )
Appendix B
• Google Chart Wizard for Campaign Budgeting – Funds Remaining
• This formula does not use custom fields, so you should be able to create a new formula field on the Campaign object and paste the formula
IF( ISBLANK( BudgetedCost ), null, IMAGE( "http://chart.apis.google.com/chart?chxr=0,0," & TEXT(BudgetedCost) & "?chxt=y&chs=300x150&cht=gm&chds=0," & TEXT(BudgetedCost) & "&chd=t:" & TEXT((BudgetedCost-ActualCost)) & "&chtt=Budgeted+Funds+Remaining" , "Campaign Success Guage" ) )