Field Validation Formulas

Embed Size (px)

Citation preview

  • 8/10/2019 Field Validation Formulas

    1/28

  • 8/10/2019 Field Validation Formulas

    2/28

    I F(I SPI CKVAL( Cont r act _St at us__c, " Act i vat ed") ,

    NOW( ) - Cont r act _Act i vat ed_Dat e__c, nul l )

    For details about using these functions, see IF, ISPICKVAL , and NOW.

    Contract Approval Process Aging

    This formula calculates how many days a contract is in the approval process. This example is a number formula fieldon contracts that uses a custom date field called Dat e i n appr oval .

    TODAY( ) - Dat e_i n_appr oval __c

    For details about using this function, see TODAY.

    Month of Last Account Activity

    This formula field displays the month of the last account activity or None if there are no activities for the account.

    CASE( MONTH( Last Act i vi t yDat e) ,

    1, "J anuar y",

    2, "Febr uar y",

    3, " Mar ch",

    4, " Apr i l " ,

    5, " May",

    6, "J une" ,

    7, " J ul y" ,

    8, "August ",

    9, " Sept ember" ,

    10, "Oct ober ",

    11, " November " ,

    12, " December " ,

    " None")

    For details about using these functions, see CASE and MONTH.

    Month of Service-Level Agreement Expiration

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IF
  • 8/10/2019 Field Validation Formulas

    3/28

    This formula returns the month that your service-level agreement expires. This example uses a custom date fieldcalled SLA Expi r at i on Dat e .

    MONTH( SLAExpi r at i onDat e__ c)

    For details about using this function, see MONTH.

    Accoun t Media Serv ice Li nks

    BBC News Search

    This formula creates a link to a BBC news search site based on the Account Name .

    HYPERLI NK(

    "htt p: / / newssear ch. bbc. co. uk/ cgi -bi n/ sear ch/ r esul t s. pl ?scope=newsi f s; t ab=news; q=" &Name,

    " BBC News" )Bloom berg News Search

    This formula creates a link to an account's ticker symbol on the Bloomberg website.

    HYPERLI NK(

    " ht t p: / / www. bl oomber g. com/ apps/ quot e?t i cker =" &Ti cker Symbol ,

    " Bl oomber g News" )

    CNN News Search

    This formula creates a link to a CNN news search site using the Account Name .

    HYPERLI NK(

    " ht t p: / / websear ch. cnn. com/ sear ch/ sear ch?source=cnn&

    i nvocat i onType=sear ch%2Ft op&si t es=web&quer y=" &Name,

    " CNN News" )

    MarketWatch Search

    This formula creates a link to an account's ticker symbol on the Marketwatch.com website.

    HYPERLI NK(

    " ht t p: / / www. mar ket wat ch. com/ t ool s/ quot es/ quot es. asp?symb=" &Ti cker Symbol ,

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTH
  • 8/10/2019 Field Validation Formulas

    4/28

    " Mar ket wat ch" )

    Google Search

    This formula creates a link to a Google search site using the Account Name .

    HYPERLI NK(

    " ht t p: / / www. googl e. com/ sear ch?en&q=" &Name,

    " Googl e" )

    Google News Search

    This formula creates a link to a Google news search site using the Account Name .

    HYPERLI NK(

    " ht t p: / / www. googl e. com/ news? en&q=" &Name,

    " Googl e News" )

    Yahoo! Search

    This formula creates a link to a Yahoo! search site using the Account Name .

    HYPERLI NK(

    " ht t p: / / sear ch. yahoo. com/ sear ch?p=" &Name,

    " Yahoo Search" )

    Yahoo! News Search

    This formula creates a link to a Yahoo! news search site using the Account Name .

    HYPERLI NK(

    " ht t p: / / news. sear ch. yahoo. com/ sear ch/ news?p=" &Name,

    " Yahoo News" )

    For details about using the function used in these formulas, see HYPERLINK.

    Case Management

    Auto di al

    This formula creates a linkable phone number field that automatically dials the phone number when clicked. In thisexample, replace " ser ver name" and " cal l " with the name of your dialing tool and the command it uses to dial.The merge field, I d, inserts the identifier for the contact, lead, or account record. The first Phone merge field tells

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINK
  • 8/10/2019 Field Validation Formulas

    5/28

    the dialing tool what number to call and the last Phone merge field uses the value of the Phone field as the linkabletext the user clicks to dial.

    HYPERLI NK( " ht t p: / / ser ver name/ cal l ?i d=" & I d & " &phone=" & Phone, Phone)

    For details about using this function, see HYPERLINK.

    Case Aging (Assign ments)

    Use this example of a custom formula field called Days Open to display different text depending on the number ofdays a case has been open:

    CASE( Days_Open__ c, 3,

    "Reassi gn", 2, "Assi gn Task", "Mai nt ai n")The following text is displayed:

    Reassign for any case open three days. Assign Task for any case open two days. Maintain for all other cases.

    For details about using this function, see CASE .

    Case Aging (Open Cases)

    This formula calculates the number of days a case has been open. If the case is closed, it sets the result to null. Addthis formula to a related list as the sort column to quickly see which open cases have been open the longest. Theformula returns zero if the case has been open for less than 24 hours.

    I F( I sCl osed,

    nul l ,

    NOW( ) - Cr eat edDat e )

    For details about using these functions, see IF and NOW.

    Case Aging (Open and Closed Cases)

    This formula calculates the number of days a closed case was open or the number of days an open case has beenopen since the date the case was created. The formula returns zero if the case has been open for less than 24 hours.

    I F( I sCl osed,

    ROUND( Cl osedDat e - Cr eat edDat e, 0) , ROUND( ( NOW( ) - Cr eat edDat e) , 0) )

    For details about using these functions, see IF, ROUND, and NOW.

    Case Categorization

    This formula displays a text value of RED, YELLOW, or GREEN, depending on the value of a case age customtext field.

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINK
  • 8/10/2019 Field Validation Formulas

    6/28

    I F( DaysOpen__c > 20, " RED" ,

    I F( DaysOpen__c > 10, " YELLOW" ,

    " GREEN" ) )

    For details about using this function, see IF.

    Case Data Completeness Tracking

    This formula calculates the percentage of specific custom fields that contain data. The formula checks the values oftwo custom number fields: Probl em Num and Sever i t y Num . If the fields are empty, the formula returns thevalue 0. The formula returns a value of 1 for each field that contains a value and multiplies this total by fifty to giveyou the percentage of fields that contain data.

    ( I F( I SBLANK( Pr obl em_Num__ c) , 0, 1) + I F( I SBLANK( Sever i t y_Num__ c ) , 0, 1) )* 50

    For details about using these functions, see IF and ISBLANK.

    Case Due Date Calcul ation

    This formula sets the due date of a case based on the priority. If it is high, the due date is two days after it opens. If itis medium, the due date is five days after opening. Otherwise, the due date is seven days.

    CASE ( Pr i or i t y,

    " Hi gh" , Cr eat edDat e + 2,

    " Medi um" , Cr eat edDat e + 5,

    Cr eat edDat e + 7)

    For details about using this function, see CASE .

    Suggested Agent Prompt s

    This formula prompts an agent with cross-sell offers based on past purchases.

    CASE( Pr oduct _Purch__ c,

    "Pr i nt er " , "Ext r a t oner car t r i dges", "Camer a", "Memor y car ds" ,

    "Speci al of t he day")

    For details about using this function, see CASE .

    Suggested Offers

    This formula suggests a product based on the support history for a computer reseller. When the Pr obl em customfield matches a field, the formula field returns a suggestion.

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISBLANKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISBLANKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISBLANKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISBLANKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IF
  • 8/10/2019 Field Validation Formulas

    7/28

  • 8/10/2019 Field Validation Formulas

    8/28

    Contact Management

    Contact's Accou nt Creation Date

    This date formula displays the account's Cr eat ed Dat e field on the contacts page.

    Account . Cr eat edDat e Contact's Account Discount Percent

    This percent formula displays the account's Di scount Per cent field on the contacts page.

    Account . Di scount _Per cent __ c

    Contact's Accoun t Name

    This formula displays the standard Account Name field on the contacts page.

    Account . Name

    Contact's Account Phone

    This formula displays the standard Account Phone field on the contacts page.

    Account . Phone

    Contact's Account Rating

    Use this formula to display the Account Rat i ng field on the contacts page.

    CASE( Account . Rat i ng, " Hot " , " Hot " , " War m" , " Warm" , " Col d" , " Col d" , " NotRat ed" )

    For details about using this function, see CASE .

    Contact's Account Website

    This formula displays the standard Account Websi t e field on the contacts page.

    Account . Websi t e If the account website URL is long, use the HYPERLINK function to display a label such as Click Here instead of theURL. For example:

    I F(Account . Websi t e="" , "" ,

    I F(

    OR( LEFT( Account . Websi t e, 7) = " ht t p: / / " , LEFT( Account . Websi t e,8) = "ht t ps : / / " ) ,

    HYPERLI NK( Account . Websi t e , " Cl i ck Her e" ) ,

    HYPERLI NK( "ht t p: / / " & Account . Websi t e , " Cl i ck Her e" )

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASE
  • 8/10/2019 Field Validation Formulas

    9/28

    )

    )

    This formula also adds the necessary "http://" or "https://" before a URL if neither were included in the URL field.

    For details about using this function, see HYPERLINK.

    Contacts Age

    Use this formula to calculate a persons age based on a standard field called Bi r t hdat e . The personsBi r t hdat e is subtracted from todays date, which returns the number of days since the persons Bi r t hdat e .This number is divided by the number of days in a year and rounded down to the nearest integer.FLOOR( ( TODAY( ) - Bi r t hdat e) / 365. 2425)

    For details about using these functions, see FLOOR and TODAY.

    Contact's Birthday

    This formula displays the value Yes if the contacts birthday falls in the current calendar month.

    I F (

    MONTH( Bi r t hdat e) = MONTH( TODAY( ) ) , " Yes" , " " )

    For details about using these functions, see IF, MONTH, and TODAY.

    Contact's LinkedIn Profile

    You can configure a link that appears on your contacts' profile page that sends you to their LinkedIn profile. To do so:

    1. Click SetupCustomizeContactsButtons and Links .

    2. Click New under Custom Buttons and Links 3. Enter a Label for this link, like Li nkedI nLi nk .4. Enter this formula in the content box:

    ht t p: / / www. l i nkedi n. com/ sear ch/ f psear ch?t ype=peopl e&keywor ds={! Cont act . Fi r st Name}+{! Cont act . Last Name}

    5. Click Save .

    Remember to add this link to the Contact page layout in order for it to show up.

    Contact Identification Numbering

    This formula displays the first five characters of the contacts last name and the last four characters of the contactssocial security number separated by a dash. Note that this example uses a text custom field called SSN on contacts.

    TRI M( LEFT( Last Name, 5) ) & " - " & TRI M( RI GHT( SSN__c, 4) )

    For details about using these functions, see TRIM, LEFT, and RIGHT.

    Contact Preferred Phone

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#FLOORhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#FLOORhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#FLOORhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TRIMhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TRIMhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TRIMhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#LEFThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#LEFThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#LEFThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#RIGHThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#RIGHThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#RIGHThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#RIGHThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#LEFThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TRIMhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#FLOORhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINK
  • 8/10/2019 Field Validation Formulas

    10/28

    This formula displays the contacts preferred contact method in a contact related listwork phone, home phone, ormobile phonebased on a selected option in a Pr ef er r ed Phone custom picklist.

    CASE( Pr ef er r ed_Phone__c,

    " Wor k", " w. " & Phone,

    " Home", " h. " & HomePhone,

    " Mobi l e" , " m. " & Mobi l ePhone,

    " No Pr ef er r ed Phone")

    For details about using this function, see CASE .

    Contact Priority

    This formula assesses the importance of a contact based on the account rating and the contact's title. If the accountrating is Hot or the title starts with Execut i ve , then the priority is high (P1). If the account rating is War m or thetitle starts with VP then the priority is medium (P2), and if the account rating is Col d then the priority is low (P3).

    I F( OR( I SPI CKVAL( Account . Rat i ng, "Hot ") , CONTAI NS( Ti t l e, "Execut i ve") ) ,"P1",

    I F( OR( I SPI CKVAL( Account . Rat i ng, "War m") , CONTAI NS( Ti t l e, " VP") ) , "P2",

    I F(I SPI CKVAL( Account . Rat i ng, "Col d") , "P3",

    "P3")

    )

    )

    Contact Yahoo! ID

    This formula displays a clickable Yahoo! Messenger icon indicating if the person is logged on to the service. Userscan click the icon to launch a Yahoo! Messenger conversation with the person. This example uses a custom text fieldcalled Yahoo Name on contacts where you can store the contact's Yahoo! Messenger ID.

    HYPERLI NK( " ymsgr : sendI M?" & Yahoo_Name__ c,I MAGE( " ht t p: / / opi . yahoo. com/ onl i ne?u=" & Yahoo_Name__c & " &m; =g&t ; =0"," Yahoo" ) )

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASE
  • 8/10/2019 Field Validation Formulas

    11/28

    For details about using these functions, see HYPERLINK and IMAGE.

    Dynamic Address Formatting

    This formula field displays a formatted mailing address for a contact in standard format, including spaces and linebreaks where appropriate depending on the country for the account.

    CASE( Shi ppi ngCount r y,

    " USA" ,

    Shi ppi ngSt r eet & BR( ) &

    Shi ppi ngCi t y & ",

    " & Shi ppi ngSt at e & " " &

    Shi ppi ngPost al Code & BR( )

    & Shi ppi ngCount r y,

    "Fr ance",

    Shi ppi ngSt r eet & BR( ) &

    Shi ppi ngPost al Code & " " &

    Shi ppi ngCi t y & BR( ) &

    Shi ppi ngCount r y, " et c")

    For details about using this function, see CASE and BR.

    Telephone Count ry Code

    This formula determines the telephone country code of a contact based on the Mai l i ng Count r y of the mailingaddress.

    CASE( Mai l i ngCount r y,

    "USA", "1",

    "Canada", "1",

    "Fr ance", "33",

    "UK", "44",

    "Aust r al i a" , "61" ,

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#BRhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#BRhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#BRhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#BRhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINK
  • 8/10/2019 Field Validation Formulas

    12/28

    "J apan", "81",

    " ? " )

    For details about using this function, see CASE .

    Unformatted Phone Number

    This formula removes the parentheses and dash characters from North American phone numbers. This is necessaryfor some auto-dialer software.

    I F( Count r y_Code__c = " 1" , MI D( Phone , 2, 3) & MI D( Phone, 7, 3) &MI D( Phone, 11, 4) , Phone)

    For details about using these functions, see IF and MID.

    Data Categorization

    Deal Size Large and Small

    This formula displays Large Deal for deals over one million dollars or Small Deal for deals under one milliondollars.

    I F( Sal es_Pr i ce__ c > 1000000,

    "Lar ge Deal ",

    "Smal l Deal ")

    For details about using this function, see IF.

    Deal Size Small

    This formula displays Small if the price and quantity are less than one. This field is blank if the asset has a price orquantity greater than one.

    I F( AND( Pri ce

  • 8/10/2019 Field Validation Formulas

    13/28

    This formula returns the date of a person's birthday in the current year, even if the person's birthday is on February29th in a leap year.

    I F( AND( MONTH( Bi r t hdat e) = 2, DAY( Bi r t hdat e) = 29) ,

    ( I F( OR( MOD( YEAR( DATEVALUE( NOW( ) ) ) , 400) = 0,AND( MOD( YEAR( DATEVALUE( NOW( ) ) ) , 4) = 0, MOD( YEAR( DATEVALUE( NOW( ) ) ) , 100) 0) ) ,

    DATE( YEAR( DATEVALUE( NOW( ) ) ) , MONTH( Bi r t hdat e) , DAY( Bi r t hdat e) ) ,

    DATE( YEAR( DATEVALUE( NOW( ) ) ) , MONTH( Bi r t hdat e + 1) , 28) ) ) ,

    ( DATE( YEAR( DATEVALUE( NOW( ) ) ) , MONTH( Bi r t hdat e) , DAY( Bi r t hdat e) ) ) )

    Day of Week (number)

    This formula calculates todays day of the week as a number (0 = Sunday, 1 = Monday, 2 = Tuesday, and so on).

    MOD( TODAY( ) - DATE( 1900, 1, 7) , 7)

    Similarly, this formula substitutes the TODAY() function shown in the previous example with a custom date fieldcalled Si gn Up Dat e . It returns the day of the week as a number for that field.

    MOD( Si gn_Up_Dat e__c - DATE( 1900, 1, 7) , 7)

    For details about using these functions, see MOD, TODAY, and DATE.

    Day of Week (text)

    This formula calculates todays day of the week and displays it as text. To determine the day of the week for a datefield, use the formula below and replace TODAY() with that date field.

    CASE(

    MOD( TODAY( ) - DATE( 1900, 1, 7) , 7) ,

    0, " Sunday" ,

    1, " Monday" ,

    2, " Tuesday",

    3, " Wednesday" ,

    4, " Thur sday",

    5, "Fr i day" ,

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#MODhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MODhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MODhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MOD
  • 8/10/2019 Field Validation Formulas

    14/28

    6, "Sat ur day", "Er r or ")

    For details about using these functions, see CASE , MOD, TODAY, and DATE.

    Day of Year

    This formula calculates todays numeric day of the year (a number between 1 and 365).

    TODAY( ) DATE( YEAR( TODAY( ) ) , 1, 1) + 1

    For details about using these functions, see TODAY, DATE , and YEAR.

    Days Until End of Mont h

    This formula displays the number of days between a specific date and the end of the month in which the date occurs.

    I F(

    MONTH( Cl oseDat e) =12,

    DATE( YEAR( Cl oseDat e) , 12, 31) - Cl oseDat e,

    DATE( YEAR( Cl oseDat e) ,

    MONTH( Cl oseDat e) +1, 1) - Cl oseDat e- 1)

    For details about using these functions, see IF, MONTH, DATE , and YEAR.

    Time of Day

    This formula returns the time of day in Greenwich Mean Time (GMT), for example: 20:04 PM).

    MI D ( TEXT ( Due_Dat e_Ti me__c) , 12, 5)

    For details about using these functions, see MID and TEXT.

    Discounting

    Maintenance and Services Discount

    This formula field uses two custom currency fields: Mai nt enance Amount and Ser vi ces Amount . It displaysDiscounted on an opportunity if its maintenance amount and services amount do not equal the opportunity Amount standard field value. Otherwise, it displays "Full Price."

    I F( Mai nt enance_Amount __c + Servi ces_Amount __c Amount ,

    "Di scount ed",

    " Ful l Pr i ce" )

    For details about using this function, see IF.

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MODhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MODhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MODhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#YEARhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#YEARhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#YEARhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#YEARhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#YEARhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#YEARhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MIDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MIDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MIDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TEXThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TEXThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TEXThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TEXThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MIDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#YEARhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#YEARhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#DATEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MODhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASE
  • 8/10/2019 Field Validation Formulas

    15/28

    Opportunity Discount Amount

    This formula calculates the difference of the opportunity Amount less the Di scount Amount . Note thatDi scount Amount is a custom currency field on opportunities.Amount - Di scount _Amount __c

    For details about using this operator, see - (Subtract) . Opportunity Discount Rounded

    Use this formula to calculate the discounted amount of an opportunity rounded off to two digits. This example is anumber formula field on opportunities that uses a custom percent field called Di scount Per cent .ROUND( Amount - Amount * Di scount _Per cent __c, 2)

    For details about using this function, see ROUND.

    Opportunity Discount with Approval

    This formula adds a Discount Approved checkbox to an opportunity. It uses conditional logic to check the value ofthe approval flag before calculating the commission.

    I F( Di scount _Approved__c, ROUND( Amount Amount * Di scount Per cent __ c, 2) ,Amount )

    For details about using these functions, see IF and ROUND.

    Employee Services

    Bonus Calculation

    This example determines an employee's bonus amount based on the smallest of two amounts: the employee's grosstimes bonus percent or an equally divided amount of the company's performance amount among all employees. Itassumes you have custom number field for Number of Empl oyees , a custom percent field for Bonus

    Per cent , and currency custom fields for the employee's Gr oss and company's Per f or mance .

    MI N( Gr oss__ c * Bonus_ Per cent __ c,

    Per f or mance__ c / Number _of _Empl oyees__ c)

    For details about using this function, see MIN.

    Employee 401K

    This example formula determines which amount to provide in employee 401K matching based on a matchingprogram of half of the employee's contribution or $250, whichever is less. It assumes you have custom currency fieldfor Cont r i but i on .

    MI N( 250, Cont r i but i on__c / 2)

    For details about using this function, see MIN.

    Hours Worked Per Week

    This formula uses a custom tab to enable time tracking of hours worked per day. It uses a formula field to sum thehours per week.

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtracthttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtracthttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtracthttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MINhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MINhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MINhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MINhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MINhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MINhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MINhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MINhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtract
  • 8/10/2019 Field Validation Formulas

    16/28

    MonHour s_ _c + TuesHours_ _c + WedsHours_ _c + Thur sHours_ _c + Fr i Hour s_ _c

    For details about using this operator, see + (Add).

    Total Pay Amoun t

    This formula determines total pay by calculating regular hours multiplied by a regular pay rate, plus overtime hoursmultiplied by an overtime pay rate.

    Tot al Pay =

    I F( Tot al _Hour s__ c

  • 8/10/2019 Field Validation Formulas

    17/28

    For details about using this function, see EXP.

    Consultant Cost

    This formula calculates the number of consulting days times 1200 given that this formula field is a currency data typeand consulting charges a rate of $1200 per day. Note that Consul t i ng Days is a custom field on opportunities.

    Consul t i ng_Days__c * 1200

    For details about using this operator, see * (Multiply).

    Gross Margin

    This formula provides a simple calculation of gross margin. In this formula example, Tot al Sal es and Cost ofGoods Sol d are custom currency fields.

    Tot al _Sal es_ _c - Cost _of _Goods_Sol d__ c

    For details about using this operator, see - (Subtract) .

    Gross Margin Percent

    This formula calculates the gross margin based on a margin percent.

    Mar gi n_per cent __ c * I t ems_Sol d__ c * Pr i ce_i t em__ c

    For details about using this operator, see * (Multiply).

    Payment Due Indicator

    This formula returns the date five days after the contract start date whenever Payment Due Dat e is blank.Payment Due Dat e is a custom date field on contracts.

    ( BLANKVALUE( Payment _Due_Dat e__ c, St ar t Dat e +5) For details about using this function, see BLANKVALUE.

    Payment Status

    This formula determines if the payment due date is past and the payment status is UNPAID. If so, it returns the textPAYMENT OVERDUE and if not, it leaves the field blank. This example uses a custom date field called PaymentDue Dat e and a text custom field called Payment St at us on contracts.

    I F(

    AND( Payment _Due_Dat e__c < TODAY( ) ,

    I SPI CKVAL( Payment _St at us__ c, " UNPAI D" ) ) ,

    " PAYMENT OVERDUE" ,

    nul l )

    For details about using these functions, see IF, AND, TODAY, and ISPICKVAL .

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#EXPhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#EXPhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#EXPhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtracthttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtracthttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtracthttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#BLANKVALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#BLANKVALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#BLANKVALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ANDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ANDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ANDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ANDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#BLANKVALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtracthttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#EXP
  • 8/10/2019 Field Validation Formulas

    18/28

    Image Links

    Yahoo! Instant Messenger Image

    This formula displays an image that indicates whether a contact or user is currently logged in to Yahoo! InstantMessenger. Clicking the image launches the Yahoo! Instant Messenger window. This formula uses a custom text fieldcalled Yahoo Name to store the contact or users Yahoo! ID.

    I F( I SBLANK( Yahoo_Name__c) , " " , HYPERLI NK( " ymsgr : sendI M?" & Yahoo_Name__c,

    I MAGE( " ht t p: / / opi . yahoo. com/ onl i ne?u=" & Yahoo_Name__ c & " &m=g&t =0", "" ) ) )

    For details about using these functions, see IF, LEN, HYPERLINK, and IMAGE.

    Skype Me Auto Dialer Button

    This formula displays an image that looks like a push button. Clicking the button automatically dials the specifiedphone number.

    HYPERLI NK( " cal l t o: / / " & " +1" & Phone,

    I MAGE( "ht t p: / / goodi es. skype. com/ gr aphi cs/ skypeme_bt n_smal l _bl ue. gi f " ,

    "Cl i ck t o Skype") )

    For details about using these functions, see HYPERLINK and IMAGE.

    Flags for Case Prior ity

    This formula displays a green, yellow, or red flag image to indicate case priority.

    I MAGE(

    CASE( Pr i or i t y,

    "Low", "/ i mg/ sampl es/ f l ag_gr een. gi f ",

    "Medi um", "/ i mg/ sampl es/ f l ag_yel l ow. gi f ",

    "Hi gh", "/ i mg/ sampl es/ f l ag_r ed. gi f " ,

    " / s. gi f " ) ,

    " Pr i or i t y Fl ag" )

    For details about using this function, see IMAGE.

    Color Squares for Case Age

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#LENhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#LENhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#LENhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#LENhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IF
  • 8/10/2019 Field Validation Formulas

    19/28

    This formula displays a 30 x 30 pixel image of a red, yellow, or green, depending on the value of a Case Age custom text field.

    I F( Case_Age__ c > 20,

    I MAGE( "/ i mg/ sampl es/ col or _r ed. gi f ", "r ed", 30, 30) ,

    I F( Case_Age__ c > 10,

    I MAGE( "/ i mg/ sampl es/ col or _yel l ow. gi f ", "yel l ow", 30, 30) ,

    I MAGE( "/ i mg/ sampl es/ col or _gr een. gi f " , "gr een", 30, 30) ,

    ) )

    For details about using these functions, see IF and IMAGE.

    Traffic Lights f or Status

    This formula displays a green, yellow, or red traffic light images to indicate status, using a custom picklist field calledPr oj ect St at us . Use this formula in list views and reports to create a Status Summary dashboard view.

    I MAGE(

    CASE( Pr oj ect _Stat us__c,

    "Gr een", " / i mg/ sampl es/ l i ght _gr een. gi f ",

    "Yel l ow", "/ i mg/ sampl es/ l i ght _yel l ow. gi f " ,

    "Red", "/ i mg/ sampl es/ l i ght _r ed. gi f " ,

    " / s. gi f " ) ,

    "s t at us col or ")

    For details about using these functions, see IMAGE and CASE .

    Stars for Rating s

    This formula displays a set of one to five stars to indicate a rating or score.

    I MAGE(

    CASE( Rat i ng__ c,

    "1", " / i mg/ sampl es/ st ar s_100. gi f " ,

    "2", " / i mg/ sampl es/ st ar s_200. gi f " ,

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IF
  • 8/10/2019 Field Validation Formulas

    20/28

    "3", " / i mg/ sampl es/ st ar s_300. gi f " ,

    "4", " / i mg/ sampl es/ st ar s_400. gi f " ,

    "5", " / i mg/ sampl es/ st ar s_500. gi f " ,

    "/ i mg/ sampl es/ st ar s_000. gi f ") ,

    " r at i ng" )

    For details about using these functions, see IMAGE and CASE .

    Consumer Reports-Style Colored Circles fo r Ratings

    This formula displays a colored circle to indicate a rating on a scale of one to five, where solid red is one, half red istwo, black outline is three, half black is four, and solid black is five.

    I MAGE(

    CASE( Rat i ng__ c,

    "1", " / i mg/ sampl es/ r at i ng1. gi f " ,

    "2", " / i mg/ sampl es/ r at i ng2. gi f " ,

    "3", " / i mg/ sampl es/ r at i ng3. gi f " ,

    "4", " / i mg/ sampl es/ r at i ng4. gi f " ,

    "5", " / i mg/ sampl es/ r at i ng5. gi f " ,

    " / s. gi f " ) ,

    " r at i ng" )

    For details about using these functions, see IMAGE and CASE .

    Horizontal Bars to Indicate Scoring

    This formula displays a horizontal color bar (green on a white background) of a length that is proportional to anumeric score. In this example, the maximum length of the bar is 200 pixels.

    I MAGE( "/ i mg/ sampl es/ col or _gr een. gi f " , "gr een", 15, I ndust r y_Scor e__c * 2)&

    I MAGE( "/ s . gi f " , "whi t e", 15,

    200 - ( I ndust r y_Scor e__c * 2) )

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGE
  • 8/10/2019 Field Validation Formulas

    21/28

    For details about using this function, see IMAGE.

    Integration Links

    Appl ic ation API Lin k

    This formula creates a link to an application outside Salesforce, passing the parameters so that it can connect toSalesforce via the Web services API and create the necessary event.

    HYPERLI NK ( " ht t ps: / / www. myi nt egr at i on. com?sI d=" & GETSESSI ONI D( ) &" ?&r owI D=" & Name & " act i on=Cr eat eTask" , " Cr eat e a Meet i ng Request " )

    For details about using these functions, see HYPERLINK and GETSESSIONID .

    Shipment Tracking Integration

    This formula creates a link to FedEx, UPS, or DHL shipment tracking websites, depending on the value of aShi ppi ng Met hod custom picklist field. Note that the parameters shown in this example for FedEx, UPS, andDHL websites are illustrative and do not represent the correct parameters for all situations.

    CASE( Shi ppi ng_Met hod__c,

    " Fedex",

    HYPERLI NK( " ht t p: / / www. f edex. com/ Tr acki ng?ascend_header =1&cl i ent t ype

    =dot com&cnt r y_code=us&l anguage=engl i sh&t r acknumber s= " &t r acki ng_i d__c, "Tr ack") ,

    "UPS",

    HYPERLI NK( " ht t p: / / wwwapps. ups. com/ WebTr acki ng/ pr ocess I nput Request ?HTMLVersi on

    =5. 0&sor t _by=st at us&l oc=en_US&I nqui r yNumber 1= " & t r acki ng_i d__c &" &t r ack. x=32&t r ack. y=7" , " Track") ,

    " DHL" ,

    HYPERLI NK( " ht t p: / / t r ack. dhl - usa. com/ Tr ackByNbr . asp?Shi pment Number =" &t r acki ng_i d__c, "Tr ack") , "" )

    For details about using these functions, see CASE and HYPERLINK. Skype Auto Dialer Integration

    This formula creates a linkable phone number field that automatically dials the phone number via the Skype VOIPphone application. It requires installation of the Skype application (a third-party product not provided bysalesforce.com) on your desktop.

    HYPERLI NK( " cal l t o: / / +" & Count r y_Code__c & Phone_Unf or mat t ed__ c, Phone)

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#GETSESSIONIDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#GETSESSIONIDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#GETSESSIONIDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#GETSESSIONIDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IMAGE
  • 8/10/2019 Field Validation Formulas

    22/28

    For details about using this function, see HYPERLINK.

    Lead Management

    Lead Agin g (for op en leads)

    This formula checks to see if a lead is open and if so, calculates the number of days it has been open by subtractingthe date and time created from the current date and time. The result is the number of days open rounded to zerodecimal places. If the lead is not open, this field is blank.

    I F( I SPI CKVAL( St at us, " Open" ) , ROUND( NOW( ) - Cr eat edDat e, 0) , nul l )

    For details about using these functions, see IF, ISPICKVAL , ROUND, and NOW.

    Lead Data Completeness

    This formula calculates the percent of certain lead fields that your sales personnel enter. The formula field checks thevalues of two custom number fields: Phone and Emai l . If the fields are empty, the formula returns the value 0.The formula returns a value of 1 for each field that contains a value and multiplies this total by fifty to give you thepercentage of fields that contain data.

    ( I F( Phone = " ", 0, 1) + I F( Emai l = "" , 0, 1) ) * 50

    For details about using this function, see IF.

    Lead Numbering

    This formula returns a number value for the text value in the auto-number field Lead Number . This can be useful ifyou want to use the Lead Number field in a calculation, such as round-robin or other routing purposes. Note thatauto-number fields are text fields and must be converted to a number for numeric calculations.

    VALUE( Lead_Number__c)

    For details about using this function, see VALUE.

    Round Robin Assig nment of Cases or Leads

    The following formula example for leads assumes you have three lead queues and you want to assign an equalnumber of incoming leads to each queue. You can also assign cases using a similar formula.MOD( VALUE( Lead_Number __c) , 3) This formula is for a custom formula field named Round_Robin_ID that assigns each lead a value of 0, 1, or 2. Thisformula uses a custom auto-number field called Lead Number that assigns each lead a unique number startingwith 1. The MOD function divides the lead number by the number of lead queues available (three in this example)and returns a remainder of 0, 1, or 2. Use the value of this formula field in your lead assignment rules to assign leadrecords to different queues. For example:

    Round_Robin_ID = 0 is assigned to Queue A

    Round_Robin_ID = 1 is assigned to Queue B Round_Robin_ID = 2 is assigned to Queue C

    For details about using these functions, see MOD and VALUE.

    Metrics

    Temperature Conversion

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#VALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#VALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#VALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MODhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MODhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MODhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#VALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#VALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#VALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#VALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MODhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#VALUEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#NOWhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ROUNDhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISPICKVALhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#HYPERLINK
  • 8/10/2019 Field Validation Formulas

    23/28

    This formula converts Celsius degrees to Fahrenheit.

    1. 8 * degrees_ cel si us__c + 32

    For details about using these operators, see * (Multiply) and + (Add).

    Unit of Measure Conversio nThis formula converts kilometers to miles.

    Mi l es__c/ . 621371192

    For details about using this operator, see / (Divide) .

    Opportun ity Management

    Days Left to Close

    This formula returns the expected number of days left to the close date of an opportunity.

    Expect ed_cl ose_dat e__c - TODAY( )

    For details about using this function, see TODAY.

    Display Close Month for Reporting Purpo ses

    This formula returns the month in text for the close date of an opportunity. Use this example when building a customreport that groups opportunities by the month of the Cl ose Dat e .

    CASE(

    MONTH( Cl oseDat e) ,

    1, "J anuar y",

    2, "Febr uar y",

    3, " Mar ch",

    4, " Apr i l " ,

    5, " May",

    6, "J une" ,

    7, " J ul y" ,

    8, "August ",

    9, " Sept ember" ,

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TODAYhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiply
  • 8/10/2019 Field Validation Formulas

    24/28

    10, "Oct ober ",

    11, " November " ,

    12, " December " ,

    "I nval i d mont h")

    For details about using these functions, see CASE and MONTH.

    Expected Product Revenue

    This formula calculates total revenue from multiple products, each with a different probability of closing.

    Pr oduct A_probabi l i t y__c * Pr oduct A_r evenue__c + Pr oduct B_probabi l i t y__c *Pr oduct B_r evenue__ c

    For details about using these operators, see * (Multiply) and + (Add).

    Maintenance Calculation

    This formula calculates maintenance fees as 20% of license fees per year. Mai nt enance Year s is a custom fieldon opportunities.

    Amount * Mai nt _Year s_ _c * 0. 2

    For details about using this operator, see * (Multiply).

    Monthly Subscription-Based Calculated Amounts

    This formula calculates an opportunity amount based on a monthly subscription rate multiplied by the subscriptionperiod.

    Mont hl y_Amount __ c * Subscr i pt i on_Mont hs__c

    For details about using this operator, see * (Multiply).

    Monthly Value

    This formula divides total yearly value by 12 months.

    Tot al _val ue__c / 12

    For details about using this operator, see / (Divide) .

    Opportunity Additional Costs

    This formula calculates the sum of the opportunity Amount , maintenance amount, and services fees. Note thatMai nt amount and Ser vi ce Fees are custom currency fields on opportunities.

    Amount + Mai nt _Amount __c + Ser vi ces_Amount __c

    For details about using this operator, see + (Add).

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#MONTHhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASE
  • 8/10/2019 Field Validation Formulas

    25/28

    Opportunity Categorization

    This formula uses conditional logic to populate an Opport uni t y cat egory text field, based on the value of theAmount standard field. Opportunities with amounts less than $1500 are Category 1, those between $1500 and$10000 are Category 2, and the rest are Category 3. This example uses nested IF statements.

    I F( Amount < 1500, " Cat egor y 1" , I F( Amount > 10000, " Cat egor y 3" ,"Cat egor y 2") )

    For details about using this function, see IF.

    Opportun ity Data Completeness

    This formula takes a group of opportunity fields and calculates what percent of them are being used by your salespersonnel. This formula field checks five fields to see if they are blank. If so, a zero is counted for that field. A 1 iscounted for any field that contains a value and this total is divided by five (the number of fields evaluated). Note thatthis formula requires you select the Tr eat bl ank f i el ds as bl anks option under Blank Field Handlingwhile the Advanced Formula subtab is showing.

    ( I F( I SBLANK( Mai nt _Amount __ c) , 0, 1) +

    I F( I SBLANK( Servi ces_Amount __ c) , 0, 1) +

    I F( I SBLANK( Di scount _Per cent __c) , 0, 1) +

    I F( I SBLANK( Amount ) , 0, 1) +

    I F(I SBLANK( Ti mel i ne__c) , 0, 1) ) / 5

    For details about using this function, see ISBLANK.

    Opportun ity Expected Lic ense Revenue

    This formula calculates expected revenue for licenses based on probability of closing.

    Expect ed_r ev_l i censes__c * Pr obabi l i t y

    For details about using this operator, see * (Multiply).

    Opportun ity Reminder Date

    This formula creates reminder date based on seven days before the close date of an opportunity. Use this formulafield in a workflow rule to create an event for the appropriate user to take action.

    Remi nder Dat e = Cl oseDat e - 7

    For details about using these operators, see = and == (Equal) and - (Subtract) .

    Opportun ity Revenue Text Display

    This formula returns the expected revenue amount of an opportunity in text format without a dollar sign. For example,if the Expect ed Revenue of a campaign is $200,000, this formula field displays 200000.

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IFhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISBLANKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISBLANKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISBLANKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Equalhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Equalhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Equalhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtracthttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtracthttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtracthttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Subtracthttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Equalhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#ISBLANKhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#IF
  • 8/10/2019 Field Validation Formulas

    26/28

    TEXT( Expect edRevenue)

    For details about using this function, see TEXT.

    Opportun ity Split Credit f or Sales Representatives

    This formula splits opportunity amount between multiple sales representatives. The t ot al r eps custom fieldindicates the total number of representatives on the deal.

    Amount / t ot al _r eps__ c

    For details about using this operator, see / (Divide) .

    Opportun ity Tot al Deal Size

    This formula calculates the sum of maintenance and services amounts.

    Amount + Mai nt _Amount __c + Servi ces_Amount __c

    For details about using this operator, see + (Add). Opportun ity Total Price Based on Units

    This formula generates proposal pricing based on unit price and total volume.

    Uni t _pr i ce__ c * Vol ume__ c * 20

    For details about using this operator, see * (Multiply).

    Professional Services Calculatio n

    This formula estimates professional service fees at an average loaded rate of $1200 per day. Consul t i ng Days is a custom field on opportunities.

    Consul t i ng_Days__c * 1200

    For details about using this operator, see * (Multiply).

    Stage-Based Sales Document Selection

    This formula Identifies a relevant document in the Documents tab based on opportunity St age . Use document IDs inthe form of 00l30000000j7AO.

    CASE( St ageName,

    "Pr ospect i ng", "I nser t 1st Document I D",

    "Qual i f i cat i on", "I nser t 2nd Document I D",

    " Needs Anal ysi s" , " I nsert 3r d Document I D" ,

    "Val ue Pr oposi t i on",

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#TEXThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TEXThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TEXThttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#TEXT
  • 8/10/2019 Field Validation Formulas

    27/28

  • 8/10/2019 Field Validation Formulas

    28/28

    Pricing

    Total Amount

    This formula calculates a total amount based on unit pricing and total units.

    Uni t _pr i ce__c * Tot al _uni t s__c

    For details about using this operator, see * (Multiply).

    User Pricing

    This formula calculates a price per user license.

    Tot al _l i cense_ r ev__ c / Number_user _l i censes__c

    For details about using this operator, see / (Divide) .

    Project Management

    Calculate Intermediate Milestone f rom End Date

    This formula calculates intermediate milestone dates by subtracting days from the end date (for projects that areplanned based on end date).

    Rel ease_Dat e__c - 7 * Phase_dur at i on_i n_weeks__ c

    For details about using this operator, see * (Multiply).

    Scoring Calculations

    Lead Scoring

    This formula scores leads, providing a higher score for phone calls than website requests.

    CASE( LeadSour ce, " Phone", 2, " Web" , 1, 0)

    Here's a formula that scores a lead based on his or her rating:

    CASE( 1, I F(I SPI CKVAL( Rat i ng, "Hot ") , 1, 0) , 3, I F(I SPI CKVAL( Rat i ng,"War m") , 1, 0) , 2, I F( I SPI CKVAL(Rat i ng, "Col d") , 1, 0) , 1) )

    For details about using this function, see CASE .

    Customer Success Scoring

    This formula uses a simple scoring algorithm to rank customers a high score for positive survey results in Salesforce.

    Sur vey_Quest i on_1__ c * 5 + Sur vey_Quest i on_2__ c *2

    For details about using these operators, se e* (Multiply) and + (Add).

    https://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Addhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#CASEhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiplyhttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Dividehttps://ap1.salesforce.com/help/doc/en/customize_functions.htm#Multiply