15
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: www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 1

Salesforce Hands-onGuide for Writing Formulas

Embed Size (px)

Citation preview

Page 1: Salesforce Hands-onGuide for Writing Formulas

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 Author Publish Date0.1 Initial Draft Chandra Prakash Sharma 10th Jan 20130.1 Review#1 Sumit Goyal 20th Jan 2013

www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 1

Page 2: Salesforce Hands-onGuide for Writing Formulas

ContentsLast Activity Month Display................................................................................................................................3Day of Week.......................................................................................................................................................4Close Date Calculation:......................................................................................................................................5Age Calculate (years old) :..................................................................................................................................7Birthday Indicator :............................................................................................................................................8Generate Employee Id Number:......................................................................................................................10Calculate Intermediate Milestone from End Date...........................................................................................11

www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 2

Page 3: Salesforce Hands-onGuide for Writing Formulas

Last Activity Month DisplayExample : 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

Page 4: Salesforce Hands-onGuide for Writing Formulas

After save formula then go to task tab and give task . you can see there is last Activity Month is available here.

Day of WeekCalculates 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.

www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 4

Page 5: Salesforce Hands-onGuide for Writing Formulas

CASE(MOD( TODAY() - DATE(1900, 1, 7), 7),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 ismedium, 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

Page 6: Salesforce Hands-onGuide for Writing Formulas

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

Page 7: Salesforce Hands-onGuide for Writing Formulas

www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 7

Page 8: Salesforce Hands-onGuide for Writing Formulas

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

Page 9: Salesforce Hands-onGuide for Writing Formulas

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.

www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 9

Page 10: Salesforce Hands-onGuide for Writing Formulas

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.

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 MonthIf 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

Page 11: Salesforce Hands-onGuide for Writing Formulas

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

Page 12: Salesforce Hands-onGuide for Writing Formulas

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 Numberseparated 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

Page 13: Salesforce Hands-onGuide for Writing Formulas

Calculate Intermediate Milestone from End DateCalculates 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