Functions in Formula Set of Salesforce | Techila
2167
single,single-post,postid-2167,single-format-standard,ajax_updown_fade,page_not_loaded,,qode_grid_1300,footer_responsive_adv,hide_top_bar_on_mobile_header,qode-content-sidebar-responsive,qode-theme-ver-9.4.2,bridge,wpb-js-composer js-comp-ver-4.12,vc_responsive
 

Functions in Formula Set of Salesforce

FUNCTIONS IN FORMULA SET OF SALESFORCE

Functions in Formula Set of Salesforce

A formula is similar to an equation that is executed at run time. Depending on the context of the formula, it can make use of various data, functions and operations to perform the calculation.

Function is a collection of operations and conditional operations that when used within a formula field allow you to perform such things as math calculations, if/and/or and string manipulation. Functions are grouped into four primary categories: Date & Time, Logical, Math and Text. In addition, there are a number of advanced functions including regular expressions, and vlookup ability. These are currently only available in some formula contexts, not all.

 

Date and Time Functions:

FunctionDescription
DATEReturns a date value from year, month, and day values you enter. Salesforce displays an error on the detail page if the value of the DATE function in a formula field is an invalid date, such as February 29 in a non-leap year.
DATEVALUEReturns a date value for a date/time or text expression.
DATETIMEVALUEReturns a year, month, day and GMT time value.
DAYReturns a day of the month in the form of a number between 1 and 31.
MONTHReturns the month, a number between 1 (January) and 12 (December) in number format of a given date.
NOWReturns a date/time representing the current moment.
TODAYReturns the current date as a date data type.
YEARReturns the four-digit year in number format of a given date.

 

Informational Functions:

Function             Description
BLANKVALUE    Determines if an expression has a value and returns a substitute expression if it does not. If the expression has a value, returns the value of the expression.
ISBLANK              Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE.
ISNULL Determines if an expression is null (blank) and returns TRUE if it is. If it contains a value, this function returns FALSE.
NULLVALUE       Determines if an expression is null (blank) and returns a substitute expression if it is. If the expression is not blank, returns the value of the expression.
Important
Use BLANKVALUE instead of NULLVALUE in new formulas. BLANKVALUE has the same functionality as NULLVALUE, but also supports text fields. Salesforce will continue to support NULLVALUE, so you do not need to change existing formulas.
PRIORVALUE     Returns the previous value of a field.

 

Logical Functions:

FunctionDescription
ANDReturns a TRUE response if all values are true; returns a FALSE response if one or more values are false.
CASEChecks a given expression against a series of values. If the expression is equal to a value, returns the corresponding result. If it is not equal to any values, it returns the else_result.
IFDetermines if expressions are true or false. Returns a given value if true and another value if false.
ISCHANGEDCompares the value of a field to the previous value and returns TRUE if the values are different. If the values are the same, this function returns FALSE.
ISNEWChecks if the formula is running during the creation of a new record and returns TRUE if it is. If an existing record is being updated, this function returns FALSE.
ISNUMBERDetermines if a text value is a number and returns TRUE if it is. Otherwise, it returns FALSE.
NOTReturns FALSE for TRUE and TRUE for FALSE.
ORDetermines if expressions are true or false. Returns TRUE if any expression is true. Returns FALSE if all expressions are false.

 

 

Math Functions:

FunctionDescription
ABSCalculates the absolute value of a number. The absolute value of a number is the number without its positive or negative sign.
CEILINGRounds a number up to the nearest integer.
DISTANCECalculates the distance between two locations in miles or kilometers.
EXPReturns a value for e raised to the power of a number you specify.
FLOORReturns a number rounded down to the nearest integer.
GEOLOCATIONReturns a geolocation based on the provided latitude and longitude. Must be used with the DISTANCE function.
LNReturns the natural logarithm of a specified number. Natural logarithms are based on the constant e value of 2.71828182845904.
LOGReturns the base 10 logarithm of a number.
MAXReturns the highest number from a list of numbers.
MINReturns the lowest number from a list of numbers.
MODReturns a remainder after a number is divided by a specified divisor.
ROUNDReturns the nearest number to a number you specify, constraining the new number by a specified number of digits.
SQRTReturns the positive square root of a given number.

 

Text Functions:

FunctionDescription
BEGINSDetermines if text begins with specific characters and returns TRUE if it does. Returns FALSE if it does not.
BRInserts a line break in a string of text.
CASESAFEIDConverts a 15-character ID to a case-insensitive 18-character ID.
CONTAINSCompares two arguments of text and returns TRUE if the first argument contains the second argument. If not, returns FALSE.
FINDReturns the position of a string within a string of text represented as a number.
GETSESSIONIDReturns the user’s session ID.
HYPERLINKCreates a link to a URL specified that is linkable from the text specified.
IMAGEInserts an image with alternate text and height/width specifications.
INCLUDESDetermines if any value selected in a multi-select picklist field equals a text literal you specify.
ISPICKVALDetermines if the value of a picklist field is equal to a text literal you specify.
LEFTReturns the specified number of characters from the beginning of a text string.
LENReturns the number of characters in a specified text string.
LOWERConverts all letters in the specified text string to lowercase. Any characters that are not letters are unaffected by this function. Locale rules are applied if a locale is provided.
LPADInserts characters you specify to the left-side of a text string.
MIDReturns the specified number of characters from the middle of a text string given the starting position.
RIGHTReturns the specified number of characters from the end of a text string.
RPADInserts characters that you specify to the right-side of a text string.
SUBSTITUTESubstitutes new text for old text in a text string.
TEXTConverts a percent, number, date, date/time, or currency type field into text anywhere formulas are used. Also, converts picklist values to text in approval rules, approval step rules, workflow rules, escalation rules, assignment rules, auto-response rules, validation rules, formula fields, field updates, and custom buttons and links.
TRIMRemoves the spaces and tabs from the beginning and end of a text string.
UPPERConverts all letters in the specified text string to uppercase. Any characters that are not letters are unaffected by this function. Locale rules are applied if a locale is provided.
VALUEConverts a text string to a number.

 

Summary Functions:

The following functions are available with summary, matrix, and joined reports.

Function

Description

PARENTGROUPVAL

This function returns the value of a specified parent grouping. A “parent” grouping is any level above the one containing the formula. You can only use this function in custom summary formulas for reports.

PREVGROUPVAL

This function returns the value of a specified previous grouping. A “previous” grouping is one that comes before the current grouping in the report. Choose the grouping level and increment. The increment is the number of columns or rows before the current summary. The default is 1; the maximum is 12. You can only use this function in custom summary formulas for reports.

 

 

Advanced Functions:

Function

Description

GETRECORDIDS

Returns an array of strings in the form of record IDs for the selected records in a list, such as a list view or related list.

INCLUDE

Returns content from an s-control snippet. Use this function to reuse common code in many s-controls.

LINKTO

Returns a relative URL in the form of a link (href and anchor tags) for a custom s-control or Salesforce page.

REGEX

Compares a text field to a regular expression and returns TRUE if there is a match. Otherwise, it returns FALSE. A regular expression is a string used to describe a format of a string according to certain syntax rules.

REQUIRESCRIPT

Returns a script tag with source for a URL you specify. Use this function when referencing the Force.com AJAX Toolkit or other JavaScript toolkits.

URLFOR

Returns a relative URL for an action, s-control, Visualforce page, or a file in a static resource archive in a Visualforce page.

VLOOKUP

Returns a value by looking up a related value on a custom object similar to the VLOOKUP() Excel function.

 

 

Encoding Functions:

Function

Description

HTMLENCODE

Encodes text and merge field values for use in HTML by replacing characters that are reserved in HTML, such as the greater-than sign (>), with HTML entity equivalents, such as >.

JSENCODE

Encodes text and merge field values for use in JavaScript by inserting escape characters, such as a backslash (\), before unsafe JavaScript characters, such as the apostrophe (‘).

JSINHTMLENCODE

Encodes text and merge field values for use in JavaScript inside HTML tags by replacing characters that are reserved in HTML with HTML entity equivalents and inserting escape characters before unsafe JavaScript characters. JSINHTMLENCODE(someValue) is a convenience function that is equivalent to JSENCODE(HTMLENCODE((someValue)). That is, JSINHTMLENCODE first encodes someValue with HTMLENCODE, and then encodes the result with JSENCODE.

URLENCODE

Encodes text and merge field values for use in URLs by replacing characters that are illegal in URLs, such as blank spaces, with the code that represent those characters as defined in RFC 3986, Uniform Resource Identifier (URI): Generic Syntax. For example, blank spaces are replaced with %20, and exclamation points are replaced with %21.

Courtesy :

https://help.salesforce.com/articleView?id=customize_functions.htm&type=0

“Explore – Techila Global Services, A Salesforce development company”

Author: techila

No Comments

Post A Comment