Newer Version Available
Sample Contact Management Formulas
| Available in: both Salesforce Classic and Lightning Experience |
| Available in: All Editions |
For details about using the functions included in these samples, see Formula Operators and Functions.
Contact's Account Discount Percent
This percent formula displays the account's Discount Percent field on the contacts page.
1Account.Discount_Percent__cContact's Account Name
This formula displays the standard Account Name field on the contacts page.
1Account.NameContact's Account Phone
This formula displays the standard Account Phone field on the contacts page.
1Account.PhoneContact's Account Rating
Use this formula to display the Account Rating field on the contacts page.
1CASE(Account.Rating, "Hot", "Hot", "Warm", "Warm", "Cold", "Cold", "Not Rated")Contact's Account Website
This formula displays the standard Account Website field on the contacts page.
1Account.Website1IF(Account.Website="", "",
2 IF(
3 OR(LEFT(Account.Website, 7) = "http://",LEFT(Account.Website, 8) = "https://"),
4 HYPERLINK( Account.Website , "Click Here" ),
5 HYPERLINK( "http://" & Account.Website , "Click Here" )
6 )
7)This formula also adds the necessary "http://" or "https://" before a URL if neither were included in the URL field.
Contact's LinkedIn™ Profile
- From the object management settings for contacts, go to Buttons, Links, and Actions.
- Click New Button or Link.
- Enter a Label for this link, like LinkedInLink.
- Enter this formula in the content box:
1http://www.linkedin.com/search/fpsearch?type=people&keywords 2={!Contact.FirstName}+{!Contact.LastName} - Click Save.
Contact Identification Numbering
This formula displays the first five characters of a name and the last four characters of a social security number separated by a dash. Note that this example uses a text custom field called SSN.
1TRIM(LEFT(LastName, 5)) &
2 "-" & TRIM(RIGHT(SSN__c, 4))Contact Preferred Phone
This formula displays the contact’s preferred contact method in a contact related list—work phone, home phone, or mobile phone—based on a selected option in a Preferred Phone custom picklist.
1CASE(Preferred_Phone__c,
2"Work", "w. " & Phone,
3"Home", "h. " & HomePhone,
4"Mobile", "m. " & MobilePhone,
5"No Preferred Phone")Contact Priority
This formula assesses the importance of a contact based on the account rating and the contact's title. If the account rating is Hot or the title starts with Executive, then the priority is high (P1). If the account rating is Warm or the title starts with VP then the priority is medium (P2), and if the account rating is Cold then the priority is low (P3).
1IF(OR(ISPICKVAL(Account.Rating, "Hot"), CONTAINS(Title, "Executive")), "P1",
2
3IF(OR(ISPICKVAL(Account.Rating, "Warm"), CONTAINS(Title, "VP")), "P2",
4
5IF(ISPICKVAL(Account.Rating, "Cold"), "P3",
6
7"P3")
8)
9)Contact Yahoo! ID
This formula displays a clickable Yahoo! Messenger icon indicating if the person is logged on to the service. Users can click the icon to launch a Yahoo! Messenger conversation with the person. This example uses a custom text field called Yahoo Name on contacts where you can store the contact's Yahoo! Messenger ID.
1HYPERLINK("ymsgr:sendIM?" & Yahoo_Name__c,
2 IMAGE("http://opi.yahoo.com/online?u=" & Yahoo_Name__c &
3 "&m;=g&t;=0", "Yahoo"))Dynamic Address Formatting
This formula field displays a formatted mailing address for a contact in standard format, including spaces and line breaks where appropriate depending on the country.
1CASE(ShippingCountry,
2"USA",
3 ShippingStreet & BR() &
4 ShippingCity & ",
5 " & ShippingState & " " &
6 ShippingPostalCode & BR()
7 & ShippingCountry,
8"France",
9 ShippingStreet & BR() &
10 ShippingPostalCode & " " &
11 ShippingCity & BR() &
12 ShippingCountry, "etc")