Skip to content

Instantly share code, notes, and snippets.

@bdunagan
Last active March 18, 2017 13:11
Show Gist options
  • Save bdunagan/3483fe0195e248de8292c3763fd2f02e to your computer and use it in GitHub Desktop.
Save bdunagan/3483fe0195e248de8292c3763fd2f02e to your computer and use it in GitHub Desktop.
Salesforce: Add an Opportunity formula field for "Release Name"
# Salesforce Custom Formula for Release Name based on Opportunity CloseDate
IF(
/* 2012 - Win 8, Mac 10 */
AND(
CloseDate >= DATE(2012,11,6),
CloseDate < DATE(2014,3,4)
),
"2012 - Win 8, Mac 10",
IF(
/* 2014 - Win 9, Mac 11 */
AND(
CloseDate >= DATE(2014,3,4),
CloseDate < DATE(2015,3,17)
),
"2014 - Win 9, Mac 11",
IF(
/* 2015 - Win 10, Mac 12 */
AND(
CloseDate >= DATE(2015,3,17),
CloseDate < DATE(2016,3,1)
),
"2015 - Win 10, Mac 12",
IF(
/* 2016 - Win 11, Mac 13 */
AND(
CloseDate >= DATE(2016,3,1),
CloseDate < DATE(2017,3,7)
),
"2016 - Win 11, Mac 13",
IF(
/* 2017 - Win 12, Mac 14 */
AND(
CloseDate >= DATE(2017,3,7),
CloseDate < DATE(2018,3,1)
),
"2017 - Win 12, Mac 14",
"-"
)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment