December 28 2016
Salesforce Tip: Adding US Timezone to Accounts
For my company’s email campaigns, we use a customer’s US time zone to determine when a particular email gets sent out. I added it as a custom formula to Accounts.
Let’s walk through how to set up a custom formula:
- Go to “Setup” > “App Setup” > “Customize” > “Accounts” > “Fields”.
- Click on “New” under “Account Custom Fields & Relationships”.
- For the field settings, use “Formula” for “Data Type”, an appropriate label for “Field Label”, and “Text” for “Formula Return Type”.
- For the formula, I translate “Billing State” into the time zone. See my version in the GitHub Gist below.
- To verify your version, use “Check Syntax”.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Salesforce Custom Formula for US Timezones based on Billing State | |
# Note there are 51 because DC counts. | |
CASE(BillingState, | |
"HI","US-PST", | |
"AK","US-PST", | |
"WA","US-PST", | |
"OR","US-PST", | |
"CA","US-PST", | |
"NV","US-PST", | |
"MT","US-MST", | |
"WY","US-MST", | |
"ID","US-MST", | |
"UT","US-MST", | |
"CO","US-MST", | |
"NM","US-MST", | |
"AZ","US-MST", | |
"ND","US-CST", | |
"MN","US-CST", | |
"WI","US-CST", | |
"SD","US-CST", | |
"IA","US-CST", | |
"IL","US-CST", | |
"KY","US-CST", | |
"TN","US-CST", | |
"AL","US-CST", | |
"MS","US-CST", | |
"AR","US-CST", | |
"MO","US-CST", | |
"LA","US-CST", | |
"TX","US-CST", | |
"OK","US-CST", | |
"KS","US-CST", | |
"NE","US-CST", | |
"MI","US-EST", | |
"OH","US-EST", | |
"IN","US-EST", | |
"GA","US-EST", | |
"FL","US-EST", | |
"SC","US-EST", | |
"NC","US-EST", | |
"VA","US-EST", | |
"WV","US-EST", | |
"PA","US-EST", | |
"DC","US-EST", | |
"MD","US-EST", | |
"DE","US-EST", | |
"NJ","US-EST", | |
"NY","US-EST", | |
"VT","US-EST", | |
"ME","US-EST", | |
"NH","US-EST", | |
"RI","US-EST", | |
"CT","US-EST", | |
"MA","US-EST", | |
"-") |