8 Apr 2016

formulas used in salesforce.com applications-----Part1

PART 1======>>> Formulas for::

• Case Management
• Commission Calculations

CASE MANAGEMENT:

Round-Robin Case Assignment
Evenly distributes cases to a pool of users using a simple round-robin algorithm. This scenario applies the MOD function to the Case Number field, to produce a number that repeatedly cycles between 1 and the number of users in the round robin pool (3 in this example). After creating this formula field, you must create case assignment rules based on it. For each value of the formula field (1, 2, or 3 in this example), you specify the user or queue assignment.
                                    |
                                    |
Formula------> MOD( VALUE({!Case Number} ), 3) + 1

Case Aging (for open cases)
Calculates the number of days a case has been open. If the case is closed, sets the result to blank. Add this formula to a related list as the sort column, and you can quickly see which currently open cases have been open the longest.
                                    |
                                    |
Formula-------> IF( {!IsClosed},null, NOW() - {!Created Date} )

Case Categorization
Displays a text value of RED, YELLOW, or GREEN, depending on case age (a custom field). This formula could be used for grouping in a summary report.
                                     |
                                     |
Formula-------> IF( {!Case_Age__c} > 20, "RED", IF({!Case_Age__c} > 10,                                                 "YELLOW","GREEN")) 

Case Due Date Calculation
Sets the due date based on the priority of the case. If it is high, due date is 2 days after being opened. If it is medium, due date is 5 days after opening. Otherwise, due date is 7 days.
                                     |
                                     |
Formula-------> IF( ISPICKVAL({!Priority}, "High"), {!Created Date} + 2, IF(                                                 ISPICKVAL({!Priority}, "Medium"), {!Created Date} + 5, {!Created                                      Date}+ 7))

Auto dial

Creates a linkable phone number field that automatically dials the phone number when clicked. In this example, replace "servername" and "call" with the name of your dialing tool and the command it uses to dial. The merge field, {!Id} inserts the identifier for the contact, lead, or account record. The first {!Phone} merge field tells the dialing tool the number to call, and the last {!Phone} merge field uses the value of the Phone field as the linkable text the user clicks to dial.
                                       |
                                       |
Formula--------> HYPERLINK("http://server name/call?id=" & {!Id} & "&phone=" &                                     {!Contact Phone}, {!Contact Phone})

 Case Aging (all cases)
Calculates the number of days a case has been open, for both open and closed cases.
                                       |
                                       |
Formula--------> IF( {!IsClosed} , ROUND({!ClosedDate} -{!CreatedDate}, 0) ,                                              ROUND((NOW() -{!CreatedDate}),0))

Suggested Offers
Suggests a product based on support history for a computer reseller. When problem (custom field) matches a field, a suggestion can be offered.
                                       |
                                       |
Formula-------> CASE( {!Problem__c} , "Memory", "Suggest new memory cards",                                 "Hard Drive failure", "Suggest new hard drive with tape backup", "")

Suggested Agent Prompts
Prompts an agent with cross-sell offers based on past purchases.
                                      |
                                      |
Formula--------> CASE( {!Product_Purch__c} , "Printer", "Extra toner cartridges",                                      "Camera", "Memory cards", "Special of the day")

COMMISSION CALCULATIONS:

Flat Rate Commission Calculation
Calculates a commission based on an Opportunity amount and percentage. This is a simple scenario where commission is a flat 8% of Opportunity amount for Closed Won Opportunities.
                                    |
                                    |
Formula--------> IF(ISPICKVAL( {!Stage Name}, "Closed Won"), ROUND({!Amount} *                                  0.08, 2), 0)

Rule-Based Commission Calculations
Calculates a commission rate based on deal size. 9% commission paid for Large Deals.
                                    |
                                    |
Formula-------> IF( {!Amount} > 100000, 0.09, 0.08 )