You are on page 1of 24

Getting Started with SalesForce CRM

Implementing Business Process in SALESFORCE Part 1

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 Beginners G ide !or Sales"orce. The doc ment !oc ses on Sales"orce #eveloper $erti!ication Hands-%n G ide &ab'(. )oin o r pro!essional training program and learn !rom e*perts.

History:
ersion #$1 #$1 Description C!ange Initial Dra%t Re+ie,-1 Aut!or Pu"lis! Date C!an&ra Pra'as! S!arma 1#t! (an )#1* Amit S!arma 1#t! (an )#1*

www.bispsol tions.com Page (

www.bisptrainigs.com

www.h+periong r .com

Contents
$ontents.......................................................................................................................... , -loo. p ........................................................................................................................... / 0EGE120eg lar E*pression3............................................................................................. / IS$H45GE# ..................................................................................................................... 6 IS5E7.............................................................................................................................. 8 P0I%0-4&9E ................................................................................................................... : parallel approval processes............................................................................................. : #+namic 4pproval Process sing 4pe* and Trigger in Sales"orce ...............................(; % tbo nd <essages as part o! an approval process ....................................................(/ 4pproval Process 7ith $ross-%b=ect "orm las ..............................................................(8 7hat are $ross-%b=ect "orm las>........................................................................... (8 0ecord data changes..................................................................................................... (: $reate 4pproval Process............................................................................................. (: -alidation 0 les To En!orce $onditional re? ired Behavior...........................................,, #ata "ormat .................................................................................................................. ,/ 4 to 5 mber @ ........................................................................................................ ,/ $hec.bo* @............................................................................................................... ,/ $ rrenc+ @................................................................................................................ ,/ #ate @....................................................................................................................... ,/ 5 mber @................................................................................................................. ,6 #ata consistenc+ @......................................................................................................... ,6

www.bispsol tions.com Page ,

www.bisptrainigs.com

www.h+periong r .com

loo'up
-&%%A9P23 is a ! nction it sed in validation, -&%%A9P " nction Similar to its E*cel co nterpart, the -&%%A9P ! nction lets +o se data in another ob=ect as a basis !or validation. 4dd a -alidation 0 le on the Emplo+ee which chec.s whether there are an+ e*isting Emplo+ee records with the same name i! so stop the 9ser !rom saving it. Here comes the role o! -&%%A9P. - $ rrentl+ Sales"orce ses -loo. p !or validations. - -&%%A9P can onl+ be done on the 5ame !ields. - The !ieldBtoBret rn m st be an a to n mber, roll- p s mmar+, loo. p relationship, master-detail relationship, chec.bo*, date, dateCtime, email, n mber, percent, phone, pic.list, te*t, te*t area, or 90& !ield t+pe. - The !ieldBonBloo. pBob=ect m st be the 0ecord 5ame !ield on a c stom ob=ect. - The !ieldBonBloo. pBob=ect and loo. pBval e m st be the same data t+pe.

RE.E/0Regular E1pression2
Regex is a regular expression it provide validation. A regular expression (regex) is a special text string for describing a search pattern in SalesForce. You are probably familiar with wildcard notations such as . or .txt to find all text files in a file manager. !he regex e"uivalent is .*\.txt$. #haracter $ / ^ . [ ] | Meaning assert end of string (or line$ in multiline mode) general escape character with several uses assert start of string or line$ in multiline mode match any character except newline start character class definition %nd character class definition start of alternative branch

www.bispsol tions.com Page /

www.bisptrainigs.com

www.h+periong r .com

( ) ? * + {

start sub pattern end sub pattern extends the meaning of $ or &'( "uantifier$ or "uantifier minimi)e & or more "uantifier ( or more "uantifier$ also *possessive "uantifier* start min'max "uantifier

Here the code !or <atching String to Email pattern In Sales"orce p blic static Boolean chec.Email"ormat2String regemail3 D String rege*emali E FGa-H4-I;-JKK.KKLKK'KKMKKNKKOKKPKKCKKEKK>KKQKKBKKRKK-KKSKK DKKTKKUKKVKF.BNR-WRXGa-H4-I;-JKK-.-WRKK.Ga-H4-IWRFY Pattern <+Pattern E Pattern.compile2rege*emali3Y <atcher <+<atcher E <+Pattern.matcher2reegemail3Y Boolean res lt E <+<atcher.matches23Y ret rn res ltY U

ISCHA3.ED
ISB&45A2E*pression3 chec. whatever an e*pression an ret rn T09E or "4&SE. Function Description 4se
ISCHA3.ED $ompares the val e o! a !ield to the previo s val e and ret rns T09E i! the val es are di!!erent. I! the val es are the same, this ! nction ret rns "4&SE.
IS$H45GE#2field3 and replace
field

with the name o! the !ield +o want to compare.

ali&ation Rule E1ample: The !ollowing validation r le prevents sers !rom changing an ob=ect name a!ter it has been created@ NOT(ISCHANGED(Name)) NOT(AND(ISCHANGED(Priority), ISPICKVAL(Priority, Low))) is a validation r le that ens res i! a ser changes the Priorit+ o! a case, the new priorit+ cannot be Z&ow.[ NOT(AND(ISCHANGED(Clo eDate), O!("ONTH(Clo eDate) #$ "ONTH(TODA%()), %EA!(Clo eDate) #$ %EA!(TODA%())),&Pro'ile(Name #$ )IT "a*a+er))) is a validation r le that prevents a ser !rom changing the $lose #ate o! an opport nit+ to a date o tside o! the c rrent month and +ear nless that ser has the ZIT <anager[ pro!ile. E*ample @- i! +o want an+ cost me ob=ect close date !ield sho ld not blan. +o can go Step \ Create \ O"5ects \ Select costume o"5ect then !ind ali&ation Rules and clic. on 3e, b tton a!ter the +o can write !orm la. then save it. www.bispsol tions.com Page 6 www.bisptrainigs.com www.h+periong r .com

IS3E6
$hec.s i! the !orm la is r nning d ring the creation o! a new record and ret rns T09E i! it is. I! an e*isting record is being pdated, this ! nction ret rns "4&SE. ali&ation Rule E1ample: 9se the !ollowing validation r le to prevent sers !rom creating a record with a close date in the past. 45# 2IS5E723, $lose#ate ] T%#4^233 chec.s i! the ser is creating a new opport nit+ and, i! so, ens res that the $lose #ate is toda+ or a!ter toda+. 9se this validation r le to ens re sers add at least one prod ct to an opport nit+ a!ter the+ have created it. 5%T2%02IS5E723,Has%pport nit+&ineItem33 In this e*ample, the validation r le !orm la displa+s the !ollowing error message when an e*isting opport nit+ does not have an+ prod cts@ _^o m st add prod cts to this opport nit+ be!ore saving._ This does not displa+ an error on the initial save beca se the+ cannot add prod cts ntil a!ter saving the record initiall+Y b t it prevents them !rom resaving or closing an opport nit+ that does not contain prod cts. E*ample @- There is +o can chec. is close date not less then to Toda+ date.

www.bispsol tions.com Page 8

www.bisptrainigs.com

www.h+periong r .com

PRIOR AL4E
Function
PRIOR AL4E

Description
0et rns the previo s val e o! a !ield.

4se
P0I%0-4&9E2field3

ali&ation Rule E1ample: The !ollowing validation r le prevents sers !rom changing the e*pected reven e o! an opport nit+ a!ter it is closed@ 45#2P0I%0-4&9E2<in pa+3 \ <in pa+, Is$losed3.

parallel appro+al processes


"or $reate Parallel 4pproval Processes !irst $reate cost me ob=ect 2E* @ Empl+ee3 then in cost me create #rop down 2Pic.list 3 !ield and give an+ name then add the +alues 0I7 8anager9 HR 8anager an& Sales 8anager9 I7 8anager : HR 8anager9 I7 8anager : Sales 8anager9 HR 8anager : Sales 8anager 9 I7 8anager : HR 8anager +alues : Sales 8anager2 E1ample: Entry criteria:; ISPIC< AL0Select ==c9>I7 8anager>2 Appro+al only to I7 manager$2 ^o can see below

www.bispsol tions.com Page :

www.bisptrainigs.com

www.h+periong r .com

For Create Appro+al Process : Setup \ Create \ 6or'%lo, : appro+als \ Appro+al Processes

Step 1 :; !ill all !ields and clic. 3e1t b tton. Step ) :; Select "orm la eval ates to tr e in drop down !ield then write !orm la

www.bispsol tions.com Page `

www.bisptrainigs.com

www.h+periong r .com

Step * :;

Step ? :; Select 5oti!ication Templates and clic. on 5e*t b tton. Step @ :; Select "ields to #ispla+ on 4pproval Page &a+o t and clic. to 5e*t b tton. Step A :; Then $lic. on Save b tton. 4!ter Then 4ssigned 4pprover Process . Step 1 :;

www.bispsol tions.com Page a

www.bisptrainigs.com

www.h+periong r .com

Step ) :;

Step * :; Select 4 tomaticall+ 4ssign then clic. on Save b tton.

www.bispsol tions.com Page J

www.bisptrainigs.com

www.h+periong r .com

Dynamic Appro+al Process using Ape1 an& 7rigger in SalesForce


#+namic approval process is sed to ro te approval re? ests to ser listed in loo. p !ields on the record re? iring approval. 4pproval Process, one emplo+ee re? est is approved or re=ected is based on his decision. b t there are 6 or 8 emplo+ee wait !or same process So in this scenario approval process de!a lt it give d+namic approval. (- 4 tomaticall+ s bmit the record !or approval on the basis o! !ield val e. ,- 4 tomaticall+ select the ne*t 4pprover. /- 4pprove C 0e=ect the record on the basis o! !ield &ynamic su"mit t!e appro+al process using trigger : p blic void d+namic4pproval2Empl+ees emp3 D CC $reate an approval re? est !or the Empl+ees 4pproval.ProcessS bmit0e? est re? E new 4pproval.ProcessS bmit0e? est23Y re?.set$omments2FS bmitting re? estF3Y re?.set%b=ectId2emp.id3Y re?.set5e*t4pproverIds2new IdGW Demp.5ewB4pproverBBcU3Y CC S bmit the approval re? est !or the Empl+ees 4pproval.Process0es lt res lt E 4pproval.process2re?3Y U Belo, met!o& is use& to &ynamic appro+e t!e process using trigger$ p blic void approve5ew2Empl+ees emp3 D 4pproval.Process7or.itemre? est re?, E new 4pproval.Process7or.itemre? est23Y re?,.set$omments2F4pproving re? est sing TriggerF3Y re?,.set4ction2F4pproveF3Y re?,.set5e*t4pproverIds2new IdGW Demp.5ewB4pproverBBcU3Y Id EmpI# E getEmpI#2emp.id3Y i!2EmpI# EE n ll3 D emp.addError2FErrorF3Y U else D re?,.setEmpI#2EmpI#3Y 4pproval.Process0es lt res lt E 4pproval.process2re?,3Y www.bispsol tions.com Page (; www.bisptrainigs.com www.h+periong r .com

U U

www.bispsol tions.com Page ((

www.bisptrainigs.com

www.h+periong r .com

Fiel& !istory trac'ing to au&it processes :


Fiel& !istory trac'ing : "ield histor+ trac.ing allows +o to save all data when the val es create new !ields and pdate val e etc. go to Setup \ Create \ O"5ects \ Select an+ costume o"5ect and Custom Fiel&s : Relations!ips and clic. on Set History trac'ing then set Trac.ing.

Au&it Processes : Setup \ Security Controls \ ie, Setup Au&io 7rail The set p a dit trail histor+ shows +o the ,; most recent set p changes made to +o r organiHation. +o can download .$S- !ile.

www.bispsol tions.com Page (,

www.bisptrainigs.com

www.h+periong r .com

Out"oun& 8essages as part o% an appro+al process


4n o tbo nd message is a wor.!low, approval, or milestone. 4n o tbo nd message sends the data in the speci!ied !ields in the !orm o! a S%4P message to the endpoint. or % tbo nd <essages are S%4P transactions that sales!orce.com a tomaticall+ sends to e*ternal s+stems when triggered. Ho, to Create Out"oun& 8essages : Setup \ Create \ 6or'%lo, : Appro+als \ Out"oun& 8essages Step 1 :;

Step ) :;

www.bispsol tions.com Page (/

www.bisptrainigs.com

www.h+periong r .com

Step *:;

www.bispsol tions.com Page (6

www.bisptrainigs.com

www.h+periong r .com

Appro+al Process 6it! Cross;O"5ect Formulas


6!at are Cross;O"5ect FormulasB
Cross-object formulas are !orm las that span two related ob=ects and re!erence merge !ields on those ob=ects. $ross-ob=ect !orm las can re!erence merge !ields !rom a master 2Zparent[3 ob=ect i! an ob=ect is on the detail side o! a master-detail relationship. Set p \ $reate \ 7or.!low O 4pprovals \ 4pproval Processes then select c stom ob=ect name and adn write the code.

www.bispsol tions.com Page (8

www.bisptrainigs.com

www.h+periong r .com

Recor& &ata c!anges


i! need to changes record data there is two wa+ !irst is direct on Sales"orce.com in #ata Import 7iHard. second is b+ sing #ata &oader. "or instance need !ile sho ld loo. li.e as the e*emplar below@ (. %ne col mn sho ld be called FI#F and it is a list o! all the records FI#sF. ,. Second col mn sho ld be called F%75E0I#F and it is a list o! all the sers I#s.

B+ sing #ata &oader +o can pload this and change 0ecord data changes. +o need to id and ownerBid the write data li.e a 5ame, $it+ etc.

Implement multi;step appro+al ,or'%lo,s an& escalations to automate "usiness processes


Business ReCuirement : we want create record Implement m lti-step approval wor.!lows. r les !or approval process below @- 4ll new recorded that are above ( a tomaticall+ enter the process. - !irst Step have s bmit manager approve or re=ect. - i! re=ect, email goes to the s bmitter manager and the record is !lagged as _re=ected_. - i! approved the ne*t approval stage is entered. i! the credit recorded is greater than 6;; then the approval goes p management - i! not then !inal step approvalC re=ection.

Create Appro+al Process


Setup \ create \ 6or'%lo,s : appro+als \ Appro+al Processes Then select the cost me ob=ect

www.bispsol tions.com Page (:

www.bisptrainigs.com

www.h+periong r .com

Step 1 :; Enter Process name or #escription then clic. on ne*t b tton. Step ) :; Select approval process and clic. to ne*t b tton.

Step * :;

www.bispsol tions.com Page (`

www.bisptrainigs.com

www.h+periong r .com

Step ? :; Select Email template and clic. on 3e1t b tton. Step @ :; Select "ields to #ispla+ on 4pproval Page &a+o t then clic. on 3e1t b tton. Step A :; select Speci!+ Initial S bmitters and clic. on Sa+e b tton. 4!ter then 4pproval process , select ^es, IFd li.e to create approval step now. clic. on Go b tton.

Step 1 :;

www.bispsol tions.com Page (a

www.bisptrainigs.com

www.h+periong r .com

Step ):;

Step * :; Select option and clic. on Sa+e b tton.

www.bispsol tions.com Page (J

www.bisptrainigs.com

www.h+periong r .com

Create an approval action for t i! !tep "


Step 1 :;

Step ):;

www.bispsol tions.com Page ,;

www.bisptrainigs.com

www.h+periong r .com

4!ter then select other approval and !inish.

www.bispsol tions.com Page ,(

www.bisptrainigs.com

www.h+periong r .com

ali&ation Rules 7o En%orce Con&itional reCuire& Be!a+ior


"or $reating -alidation r les clic. on Setup \ Create \ O"5ects \ select an+ ob=ect name then !ind -alidation 0 le then $lic. on 3e, b tton.

www.bispsol tions.com Page ,,

www.bisptrainigs.com

www.h+periong r .com

Data Format
Auto 3um"er :
4 #ispla+ "ormat allows +o to control the appearance o! the 4 to 5 mber !ield. 4 #ispla+ "ormat consists o! the s bstit tion variables described below, pl s an+ other characters +o wish to incl de as a pre!i* or s !!i*.

C!ec'"o1 :
4llows sers to select a Tr e 2chec.ed3 or "alse 2 nchec.ed3 val e. chec.bo* ret rn val e onl+ 2Tr e C "alse 3.

Currency :
Please enter the length o! the n mber and the n mber o! decimal places. "or e*ample a n mber with a length o! ` and 6 decimal places can accept val es p to _a`68(,8.,86a_. In Ape1 : ]ape*@ o tp tTe*t val eE_string@ D;,n mber,M','''.''U_\ ]ape*@ param val eE_DLan+n mberU_ C\ ]Cape*@o tp tTe*t\

Date :
E*ample @ ]ape*@o tp tTe*t val eE_D;, date, ddFCF<<FCF++++ HH@mm@ssU \ ]ape*@param val eE_DL )obB4pplications.EndB#ateBTimeBBcU_\ ]Cape*@param\

www.bispsol tions.com Page ,/

www.bisptrainigs.com

www.h+periong r .com

3um"er :
Please enter the length o! the n mber and the n mber o! decimal places. "or e*ample a n mber with a length o! 8 and , decimal places can accept val es p to _68(,8.6a_. E1ample : ]ape*@page standard$ontrollerE_4cco nt_\ ]ape*@o tp tTe*t val eE_D;, n mber, ;;;,;;.;;U_\ ]ape*@param val eE_DL4cco nt.<a*SalU_ C\ ]Cape*@o tp tTe*t\ ]Cape*@page\

Data consistency :
#ata $onsistenc+ means that each ser sees a consistent view o! the data, incl ding visible changes made b+ the serFs own transactions and transactions o! other sers. - Eliminate # plicate #ata 4 tomaticall+. - $leanse, Standardise and $onsolidate +o r data. - $reate a Single Tr sted -iew o! +o r $ stomers. - Integrate Important #ata !rom 4ll o! +o r S+stems. - Generate 4cc rate and $omplete 0eports.

www.bispsol tions.com Page ,6

www.bisptrainigs.com

www.h+periong r .com