Salesforce Hands-onGuide for Writing Formulas
Short Description
BISP is committed to provide BEST learning material to the beginners and advance learners. In the same series, we have p...
Description
Getting Started with SalesForce CRM Business Processes Formula in SalesForce CRM
Description: BISP is committed to provide BEST learning material to the beginners and advance learners. In the same series, we have prepared a complete end-to end Hands-on Beginner’s Guide for SalesForce. The document focuses guide you through the various examples of writing complex formulas. Join our professional training program and learn from experts.
History: Version Description Change 0.1 Initial Draft 0.1 Review#1
www.bispsolutions.com
Author Chandra Prakash Sharma Sumit Goyal
www.bisptrainigs.com
Publish Date 10th Jan 2013 20th Jan 2013
www.hyperionguru.com
Page 1
Contents Contents............................................................................................................................................ 2 Last Activity Month Display................................................................................................................3 Day of Week...................................................................................................................................... 4 Close Date Calculation:..................................................................................................................... 5 Age Calculate (years old) :................................................................................................................. 8 Birthday Indicator :............................................................................................................................. 9 Generate Employee Id Number:......................................................................................................12 Calculate Intermediate Milestone from End Date.............................................................................13
www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 2
Last Activity Month Display Example : There is one organization admin assign task for employee how to admin or employee how to know what is last assign month. Displays the month of the last account activity or is blank if there are no activities for the account.
Solution : Login in your SalesForce Account under login you can see Setup > Object > Select custom object , Then add new custom field Click on New button. select Formula > Text and there enter formula for Last activity month. then Save this .
Formula Code : CASE( MONTH( Close_Date__c ) ,1, "January", 2, "February", 3, "March", 4, "April", 5, "May", 6, "June", 7, "July", 8, "August", 9, "September", 10, "October", 11, "November", 12, "December", "blank")
www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 3
After save formula then go to task tab and give task . you can see there is last Activity Month is available here.
Day of Week Calculates Task Start Date day of the week and displays as text. Example : when you assign task start date (30/4/2014) how to know in (30/4/2014) which day . show day of week by using formula.
Solution : Add Formula Field as a text field. How to add : Login in your SalesForce Account under login you can see Setup > Object > Select custom object , Then add new custom field Click on New button. select Formula > Text and there enter formula.
CASE(MOD( TODAY() - DATE(1900, 1, 7), 7), www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 4
0, "Sunday", 1, "Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday", 5, "Friday", 6, "Saturday","Show Error ")
Close Date Calculation: Due date based on the priority of the case. If it is high, due date is 1 days after being opened. If it is medium, due date is 3 days after opening. Otherwise, due date is 5 days. If Priority is high Task End Date (Close Date - 1), If priority is Medium Task End Date (Close Date + 1), If Priority is Low Then Task End Date (Close Date + 2) Solution : Firstly Create Custom Field as a Formula Type, under the formula type select Date Data Type. How To Create Custom Field as a Formula Type: Setup > Create > Object > Select any Custom Object (Ex: Assign Task), Then find here " Custom Fields & Relationships " Section, under this section click on New button. see below. Step 1 :
Step 2 : After click on New button, Select Formula type then click on Next button. Step 3 : Then Select Date type Data Type, and enter then data type name and click on Next button. Step 4 : After then write here formula. Then Save it.
www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 5
IF( ISPICKVAL( priority__c , "High"), Close_Date__c - 1, IF( ISPICKVAL(priority__c, "Medium"), Close_Date__c + 1, Close_Date__c + 2)) Step 5 : Then click on Assign Task Tab. see below
www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 6
www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 7
Age Calculate (years old) : Example : In organization there is Employee Detail page in this page store all detail about employee, we need t o calculate employee how year old employee, calculate on Dob field. by using formula field. Solution : Firstly Create Custom Field as a Formula Type, under the formula type select Date Data Type.
www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 8
How To Create Custom Field as a Formula Type: Setup > Create > Object > Select any Custom Object (Ex: Employee Detail), Then find here " Custom Fields & Relationships " Section, under this section click on New button. see below. Step 1 :
Step 2 : After click on New button, Select Formula type then click on Next button. Step 3 : Then Select Date, Data Type, and enter then data type name and click on Next button. Step 4 : After then write here formula. Then Save it.
Step 5 : After Save then go to Employee Detail page .
Birthday Indicator : Example : If Employee Birth Day is same month and day it show birth Day on same day. Solution : Firstly Create Custom Field as a Formula Type, under the formula type select Date Data Type. How To Create Custom Field as a Formula Type:
www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 9
Setup > Create > Object > Select any Custom Object (Ex: Employee Detail), Then find here " Custom Fields & Relationships " Section, under this section click on New button. see below. Step 1 :
Step 2 : After click on New button, Select Formula type then click on Next button. Step 3 : Then Select Text Data Type, and enter then data type name and click on Next button. Step 4 : After then write here formula. Then Save it.
Formula : IF( DAY( Date_of_Birth__c ) = DAY(TODAY()),"Happy Birth Day : " +Employee_Name__c,IF(MONTH( Date_of_Birth__c) = MONTH( TODAY()) , Employee_Name__c + " Birth Day In This Month", "This Month No Birth Day")) Step 5 : After that go to Employee Tab and check it. see below. If Birth Day and Current Date is same : it show Happy Birth Day : Employee Name If Birth Day and Current Date Not Same but Current Month Same it show : Employee Name Birth Day In This Month If Birth Day and Current Date or Current Month not same it show : This Month No Birth Day
If Birth Day and Current Date is same :
www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 10
If Birth Day and Current Date Not Same but Current Month :
If Birth Day and Current Date or Current Month not same :
www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 11
Generate Employee Id Number: Example : Generate Employee Id Number in Organization we have some requirement Displays the first 5 characters of the Employee name and the last 3 characters of the Employee Number separated by a dash. Solution : Firstly Create Custom Field as a Formula Type, under the formula type select Date Data Type. How To Create Custom Field as a Formula Type: Setup > Create > Object > Select any Custom Object (Ex: Employee Detail), Then find here " Custom Fields & Relationships " Section, under this section click on New button. see below. Step 1 :
Step 2 : After click on New button, Select Formula type then click on Next button. Step 3 : Then Select Text Data Type, and enter then data type name and click on Next button. Step 4 : After then write here formula. Then Save it.
Step 5 : See below.
www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 12
Calculate Intermediate Milestone from End Date Calculates intermediate milestone dates by subtracting days from Release Date (for projects that are planned based on Release Date). How To Create Custom Field as a Formula Type: Setup > Create > Object > Select any Custom Object (Ex: Employee Detail), Then find here " Custom Fields & Relationships " Section, under this section click on New button. see below. Step 1 :
Step 2 : After click on New button, Select Formula type then click on Next button. Step 3 : Then Select Date, Data Type, and enter then data type name and click on Next button. Step 4 : After then write here formula. Then Save it.
Step 5 : After Save this formula .
www.bispsolutions.com
www.bisptrainigs.com
www.hyperionguru.com
Page 13
View more...
Comments