Create a gist now

Instantly share code, notes, and snippets.

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