SF_formulas_cheatsheet
SF_formulas_cheatsheet
()
Logical Functions
Specifies that the expressions within the open parenthesis and close
parenthesis are evaluated first. All other expressions are evaluated
using standard operator precedence. AND Returns TRUE response if all values are true; returns a
FALSE response if one or more values are false.
Logical Operators
CASE Checks a given expression against a series of values. If the expression
is equal to a value, returns the corresponding
= and == Evaluates whether two values are equivalent. result. If it is not equal to any values, it returns the else_result.
<> and != Evaluates whether two values are not equivalent. IF Determines whether expressions are true or false. Returns a given
value if true and another if false.
< Evaluates whether a value is less than the value that follows this
symbol.
ISCHANGED Compares the value of a field to the previous value and
> returns TRUE if the values are different. If the values are the same,
Evaluates whether a value is greater than the value that follows
this function returns FALSE.
this symbol.
<= ISNEW Checks whether the formula is running during the creation of a
Evaluates whether a value is less than or equal to the value that
follows this symbol. new record and returns TRUE if it is. If an existing record is being
updated, this function returns FALSE.
>= Evaluates whether a value is greater than or equal to the value that
follows this symbol. ISNUMBER Determines whether a text value is a number and returns
TRUE if it is. Otherwise, it returns FALSE.
&& Evaluates whether two values or expressions are both true.
Use this operator as an alternative to the logical function AND. NOT Returns FALSE for TRUE and TRUE for FALSE.
|| Evaluates whether at least one of multiple values or expressions is OR Determines whether expressions are true or false. Returns TRUE if
true. Use this operator as an alternative to the logical function OR. any expression is true. Returns FALSE if all expressions are false.
http://developer.salesforce.com
Math Functions Text Functions
ABS Calculates the absolute value of a number. The absolute value of a BEGINS Determines whether text begins with specific characters and
number is the number without its positive or negative sign. returns TRUE if it does. Returns FALSE if it does not.
MAX Returns the highest number from a list of numbers. GETSESSIONID Returns the user’s session ID.
MIN Returns the lowest number from a list of numbers. HYPERLINK Creates a link to a URL from the specified text.
MOD Returns a remainder after a number is divided by a specified divisor. IMAGE Inserts an image with alternate text and height/width
specifications.
ROUND Returns the nearest number to a number you specify, constraining
the new number by a specified number of digits. INCLUDES Determines whether any value selected in a multi-select picklist
field equals a text literal you specify.
SQRT Returns the positive square root of a given number.
ISPICKVAL
Advanced Functions Determines whether the value of a picklist field is equal to a text
literal you specify.
RIGHT Returns the specified number of characters from the end of a text
REQUIRESCRIPT Returns a script tag with source for a URL you specify. Use
this function when referencing the Force.com AJAX Toolkit or string.
other JavaScript toolkits.
RPAD Inserts your specified characters to the right side of a text string.
URLFOR Returns a relative URL for an action, s-control, or a file in a static
resource archive in a Visualforce page. SUBSTITUTE Substitutes new text for old text in a text string.
VLOOKUP Returns a value by looking up a related value on a custom object TEXT Converts a percent, number, date, date/time, or currency type field
similar to the VLOOKUP() Excel function. into text anywhere formulas are used. Also, converts picklist values
to text in validation rules, formula fields, and field updates.
Encoding Functions
TRIM Removes the spaces and tabs from the beginning and end of a
text string.
HTMLENCODE Encodes text and merge field values for use in HTML by replacing
characters that are reserved in HTML, such as the greater-than UPPER Converts all letters in the specified text string to uppercase.
sign (>), with HTML entity equivalents, such as >. Any characters that are not letters are unaffected by this function.
Locale rules are applied if a locale is provided.
JSENCODE Encodes text and merge field values for use in JavaScript by
inserting escape characters, such as a backslash (\), before unsafe VALUE Converts a text string to a number.
JavaScript characters, such as the apostrophe (‘).
JSINHTMLENCODE Encodes text and merge field values for use in JavaScript within
Summary Functions
HTML tags by inserting escape characters before unsafe JavaScript
characters and replacing characters that are reserved in HTML Only used in the context of creating custom summary formulas for summary reports.
with HTML entity equivalents.
PARENTGROUPVAL A summary function that returns the value of the selected
URLENCODE Encodes text and merge field values for use in URLs by replacing summary field from the parent grouping level that you specify.
characters that are illegal in URLs, such as blank spaces, with
the code that represent those characters as defined in RFC 3986, PREVGROUPVAL A summary function that returns the value of the selected
Uniform Resource Identifier (URI): Generic Syntax. For example,
summary field from the previous summary row at the grouping
blank spaces are replaced with %20, and exclamation points are
level that you specify.
replaced with %21.