Sunteți pe pagina 1din 11

Salesforce approval process :

==============================

1 . Navigation :
------------

Setup
|
|--->Build
|
|--->Create
|
|--->Workflow &Approvals
|
|------>Approvals
|
|--->New Approvals

2 . Choose the Object

3 . Choose single step Approval or MultiStep Approvals

Jump Start Wizard : When we want to create single step Approval process then select
Jump Start Wizard.
==================

Standard setup wizard : When we want to create multistep approval process then We
will select standard setup wizard
======================

Step 1: Enter Approval process name and description.

Step 2: Specify the entry criteria :

The records which are meeting this criteria can only be submitted for
approval

We can create criteria in two ways


1.using Formules
2.Criteria based condition

Note : If you are using criteria based condition then we can form 25
conditions in a single Codition.
======

Step 3: Select the email template to notify the approver that record is sent to
him for approval

Step 4: Specify Automated Approver:

Step 5: Select the list of users who can submit the record for approval

step 6: click on Save button and click on View Approvalprocess Detailpage.

Approvalprocess actions : [New Task, Filed Update, Email Sending, Outband Messages]
=========================
1. Initial Submission Actions : Initial submission actions take place when a
record is initially submitted for approval.
For example, an initial submission action
can change a record's status to "Pending" or send a notification email.

2. Final Approval Actions : Final approval actions take place after a record
has received all necessary approvals.
For example, a final approval action can change a
record's status to "Approved" or send a notification email.

3. Final Rejection Actions : Final rejection actions take place when a record
has been completely rejected from the approval process.
For example, a final rejection action can change a
record's status to "Rejected," send a notification email, or unlock the record.

4. Recall Actions : Recall actions take place when a submitted approval


request is recalled.
For example, a recall action can change the record's status
from "In Progress" to "Not Submitted."

===================================================================================
===================================================

Example :
=========

Object Name : Account

Fields :

Field Name DataType Standard/Custom

Name Text Standard

Email Email Custom

Amount Curreney Custom

Approval Status PickList Custom


Pending
Approved
Rejected
Recalled

----------------------------------------------------------------------
Approval Process :
-----------------------------------------------------------------------
Submit Step :
===============
1. Object : Account

2. Wizard : Use Jump Start wizard

3. Approval Process Name : New Account Record Approval Process

4. Entry Criteria : Amount Gretarthan(>) 100000


5. Select Approver : Automatically assign to approver(s). (Select the Users)

6. When multiple approvers are selected : Approve or reject based on the FIRST
response.

7. Click on Save

8. Click on View Approvalprocess Detailpage.

Apporoval Actions :
===================

1. Initial Submission Actions :


-------------------------------

Step 1: Initial Submission Action :

Field update :Approval Status : Pending

2. Final Approval Actions :


---------------------------

Step 1: Approval Action :

Field update :Approval Status : Approved

3. Final Rejection Actions :


----------------------------

Step 1 : Rejection Action :

Field Update : Approval Status : Rejected

4. Recall Actions :
------------------

Step 1 : Recall Action :

Field Update : Approval Status : Recalled

Observation :
=============

Create a Account record with Ammount > 100000

Submitte Record for Approval

if user approved then Approval Status Picklist updates to Approved.

if user Rejected then Approval Status Picklist updates to Rejected.


===================================================================================
===================================================

Example 2 :
==========

1. Create an object :

Object Name : Student

Fields :

Field Name DataType Standard/Custom

Name Text Standard

Email Email Custom

Phone Phone Custom

Course Lookup(Course) Custom

Status PickList Custom


Approved
Rejected

----------------------------------------------------------------------
Approval Process :
-----------------------------------------------------------------------
Submit Step :
===============
1. Object : Student

2.Wizard : Standard setup wizard

3. Approval Process Name : New Admission

4. Entry Criteria : Formule :

if course StartDate is less than today

5.AutoMaterd : None

6.Record Editability : Admin and currently assigned Approver

7. Email Template : Choose the template which you want to send as


notification

8. Approval Layout Field: Name , Email ,Course,Phone

9. Show Approval History along with Fields : No

10.Security Settings : Allow Approvers to access Apporval page from Salesforce


and
wireless devices

11.Intial Submiters : kavaya


12. Allow callback : yes

Apporoval Steps1:
===================

Step 1: Process name : Manager Approval

Step 2: Which records : All reocrs

Step 3: Choose Approver :

Assign to User : Satish and wilson

Type of Paralled Approval : First Response Approval

Step 4: Approval Action :

Field update :Status : Approved

Rejection Action :

Field Update : Status :rejected

===================================================================================
===================================================

Process Builder :
=================

|-----------------------------------------------|----------------------------
----------------------|
| | |
| Process Builder [8 actions ] | Workflow [4 actions]
|
| |
|
|-----------------------------------------------|----------------------------
----------------------|
| | |
| 1 . Created a Record | 1 . New Task
Create |
| | |
| 2 . Submit for Approval | 2 . Email
sending |
| | |
| 3 . Email Alert | 3 . Field update
|
| | |
| 4 . Post to chatter | 4 . Send Out
bound messages |
| | |
| 5 . Field update |
|
| | |
| 6 . Apex |
|
| | |
| 7 . Launch a wizard |
|
| | |
| 8 . Quick Actions |
|
| | |
|-----------------------------------------------|----------------------------
----------------------|

1. Navigation :
---------------

Setup
|
|--->Build
|
|--->Create
|
|--->Workflow & Approvals
|
|------> Process Builder
|
|---> New Process Builder

2 . Enter The Process Name .

3 . Add the Object . [ when a record is created or edited ]

4 . Add the Criteria .

5 . Select the Actions .

6 . Don�t forget to active the Process by clicking on the Activate button.

===================================================================================
==================================================

Example : Create a Record


=========

1 . Process Name : Auto Contact Record Create when Account creates


The process starts when : A Record changes

2 . Add the Object : Account [ when a record is created or edited ] click on Save

3 . Add the Criteria : Amount > 100000. [Criteria Name also Same ]
Select : All of the conditions are met (AND)
4 . Add the Action : Action Type --> Create a Record.

Action Name -->Auto Contact reated.

Record Type --> Contact.

Set Field Values --> LastName -- Field Reference -- Account


Name.

5 . Save.

6 . Activate the Process builder.

===================================================================================
==================================================

Example : Submit for Approval


=========

1 . Process Name : Submit for Approval when Account creates


The process starts when : A Record changes

2 . Add the Object : Account [ when a record is created or edited ] click on Save

3 . Add the Criteria : Amount > 100000. [Criteria Name also Same ]
Select : All of the conditions are met (AND)

4 . Add the Action : Action Type --> Submit for Approval.

Action Name --> Auto Submit for Approval.

Object --> Account.

Approval Process ---> Specific Approval Process --> Select


the Approval Process [or] Create approval process

Submitter ---> Current User

5 . Save.

6 . Activate the Process builder.

===================================================================================
==================================================

Example : Email Alert


=========

1 . Process Name : Email Alert when Account creates


The process starts when : A Record changes

2 . Add the Object : Account [ when a record is created or edited ] click on Save

3 . Add the Criteria : Amount > 100000. [Criteria Name also Same ]
Select : All of the conditions are met (AND)

4 . Add the Action : Action Type --> Email Alert.


Action Name --> Auto Email Alert.

Email Alert ---> Select the Email Alert [or] Create new
Email Alert

5 . Save.

6 . Activate the Process builder.

===================================================================================
==================================================

Chatter is a corporate network that lets your users work together, talk to each
other, and share information, all in real time

Example : Post to Chatter


=========

1 . Process Name : Post to Chatter when Account creates


The process starts when : A Record changes

2 . Add the Object : Account [ when a record is created or edited ] click on Save

3 . Add the Criteria : Amount > 100000. [Criteria Name also Same ]
Select : All of the conditions are met (AND)

4 . Add the Action : Action Type --> Post to Chatter.

Action Name --> Auto Post to Chatter.

Post to ---> Select This Record

Message : write the message using Merge fields

Ex : Hello
New Account is Created {![Account].Name} with
the Amount {![Account].Amount__c}
Thanks .

5 . Save.

6 . Activate the Process builder.

===================================================================================
=================================================

Example : Field Update [Parent to Child Update]


=========

Parent Obj : Account

Child Obj : Contact

Relationship : Lookup Relationship


1 . Process Name : Account Related Contacts Title Update
The process starts when : A Record changes

2 . Add the Object : Account [ when a record is created or edited ] click on Save

3 . Add the Criteria : Amount > 100000. [Criteria Name also Same ]
Select : All of the conditions are met (AND)

4 . Add the Action : Action Type --> Field Update .

Action Name --> Auto Account Related Contacts Title Update.

Record Type --> Select a record related to the Account --->


Contacts

Criteria for Updating Records : No criteria�just update the


records.

Set new field values for the records you update : Title --
String -- Venkat Yadav

5 . Save.

6 . Activate the Process builder.

Note :
******
1 . Using Process Builder "Parent to Child" & "Child to Parent" Field Update
Possible.

2 . Process Builder Supports Lookup Relationship & Master Detail


Relationship.

===================================================================================
===================================================

Example : Apex Class Methad [When Account Status = 'Closed' then Automatically
Contacts Status Should be Closed]
=========

On Account obj -->Create Picklist field Status=[Open/Closed]

On Contat obj -->Create Picklist field status=[Open/Closed]

1 . Process Name : Apex Class Methad When Account Stutas ='Closed' Auto
Contact Status ='closed'
The process starts when : A Record changes

2 . Add the Object : Account [ when a record is created or edited ] click on Save

3 . Add the Criteria : Stutas = Closed. [Criteria Name also Same ]


Select : All of the conditions are met (AND)
4 . Add the Action : Action Type --> Apex.

Action Name -->When Account Stutas ='Closed' Auto Contact


Status ='closed'.

Apex Class --> RelatedConatctHandler.

Set Apex Variables --> accountidList-- Field Reference --


Account ID.

5 . Save.

6 . Activate the Process builder.

Apex Class :
===========

public class RelatedConatctHandler {


@invocableMethod
public Static void closeContactForAccounts(List<id> accountidList){
List<Contact> contactList=[select id,status__c from contact where
status__c!='Closed' AND Account.Status__c='Closed' AND Accountid in
:accountidList];
for(contact c:contactList) {
c.status__c='Closed';
}
update contactList;
}
}

NOTE :
******
1 . in order to invoke Apex class From Process Builder, you need to make sure
the class has a method declared with "@invocableMethod" annotation

2 . an Apex class can only have one invocableMethod.

3 . an invocableMethod must be defind as static and either public or global.

4 . Other annotations cannot be combined with the invocableMethod annotation.

5 . invocableMethod cannot be used in Apex Triggers

===================================================================================
=================================================

Process Builders cannot handle :


================================

1 . Process Builders cannot handle before DML It executes after a record has been
created or updated.
Whereas Apex triggers can handle both before and after DML operations.
2 . Process Builder cannot handle delete and undelete DML. Whereas Apex triggers
can handle all DML operations.

3 . Whenever a particular use case is not possible using Process Builder, consider
using Apex triggers.

S-ar putea să vă placă și