function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Aladdin USAladdin US 

Triggers and Workflows.

Hi, 

When do you go for a Workflow and when do you go for Trigger? How do you decide?

Can any one help me.

Thanks.
Priyananth RPriyananth R
Hi, 

Workflow : (It's under category of Admin)

Condition : One if/then statement 
Example :
if(account.Name == 'Anandh') {
    then action Performed;
}
Process Start : When the record is created, updated and subsequently updated
Available Actions : New Task, New Email Alert, New Field Update, New Outbound Message
Field Update : Record and Parent itself
Above Process are only possible via workflow. 

Trigger :(It's under category of Developer)

Process Start :
when the record is before insert, before update, before delete, after insert, after update, after delete, after undelete
Available Actions : Better look through trailhead : https://trailhead.salesforce.com/en/content/learn/modules/apex_triggers/apex_triggers_intro
Usually an APEX (code) based evaluation of criteria to set of a chain of events

 
Deepali KulshresthaDeepali Kulshrestha
Hi Aladdin,

1. Workflow is point and click which doesn't need any coding. When you want to take action (email, task, field update or outbound message) for the same object or from Child to parent object, you can use Workflow rules.

2. Trigger: It's a programatic approach and event driven (insert, update, merge, delete). You can call it as advance version of Workflow.

Trigger works across all the objects.
You can create a new record through trigger which is not possible through workflow.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha