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
abc def 8abc def 8 

What is the difference between workflow and triggers? When to use workflow and when to use trigger ?

What is the difference between workflow and triggers? When to use workflow and when to use trigger ?
PratikPratik (Salesforce Developers) 
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.

Hope this will help you!

Thanks,
Pratik

P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.
satheesh8.k1.3890099515516848E12satheesh8.k1.3890099515516848E12
Hi
Main Difference between workflow and trigger.
Whenever we do DML operations like (insert,update,delete ) then you go for Trigger concept ,but here we cann't do DML operation using Workflow. .Trigger works before and after some actions,Coding is required.    Workflows work only after some actions, Coding is not required.

Thanks
Satheesh
MithunPMithunP
Hi,

Workflow
Workflow is automated process that fired an action based on Evaluation criteria and rule criteria.
Workflow Rules will be helpful to update the same object or master object in custom master-detail relationships.
We cannot query from database
Coding is not required.
Workflows work only after some actions.

Trigger
Trigger can work across objects.
Coding is required.
Trigger works before and after some actions.

Best Regards,
Mithun.
Vijay NagarathinamVijay Nagarathinam
Hi,

Please find the diifference between trigger and workflow.

Triggers:
1. Trigger can work across objects.
2. Trigger works before and after some actions + On different DML actions like Insert, Update, Delete, Undelete
3. Coding is required.
4. Often needed for roll-up type scenarios where roll up summary fields cannot be used and also when a record needs to be created on a different object

Workflow rules:
1. Workflow Rules will be helpful to update the same object or master object in custom master-detail relationships.
2. Coding is not required and they currently can only result in a task, email, field update, or outbound message
3. Workflows work only after some actions i.e. entry criteria's
4. they can only cross objects in a master detail relationship, from the detail to the master, and only for certain scenarios (all custom to custom objects, some custom to standard objects, and even fewer standard to standard) https://help.salesforce.com/HTViewHelpDoc?id=workflow_cross_object_field_updates.htm&language=en_US
5. you cannot create records from WF
 
RaJesh NandiGamRaJesh NandiGam
Validations/workflows :
* It will work only with the dml operations like Insert and Update.
*Will work only with one S-object.
*Mostly it is used for the small scenarious.
Triggers:
* It will work with all Dml operations including delete and Undelete.
* It will work with Cross Object reference also.
*It is used in the Competation Scenario.



Regards | Nandigam
Deepali KulshresthaDeepali Kulshrestha
Hi,

Workflow

1:-- You cannot create records.

2:-- They currently can only result in a task, email, field update, or outbound message.

3:-- They can only cross objects in a master detail relationship, from the detail to the master,
 and only for certain scenarios (all custom to custom objects, some custom to standard objects,
 and even fewer standard to standard)We can not perform Dml operation in workflowWe cannot query from database.
 
4:-- Trigger can work across objects and where in you can query the object as well as you can do DMLs.
 
 
Trigger


1:-- Can do these things, but obviously using code.

2:-- Often needed for roll-up type scenarios where roll up summary fields cannot be used.

3:-- Often needed when a record needs to be created on a different objectWe can use 20 Dml operations 
in trigger. Trigger can be used to invoke a webserive.

4:- Trigger can work across objects and where in you can query the object as well as you can do DMLs.


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
www.kdeepali.com
Sangeeta Patra 11Sangeeta Patra 11
Hi,

Please see the difference between workflow and Triggers:
  1. Workflow:
    1. Workflow is point and click which doesn't need any coding.
    2. We can use workflow to take action (email, task, field update or outbound message) based on evaluation & rule criteria. Workflow is triggered after the action.
    3. Workflow Rules will be helpful to update the same object or master object in custom master-detail relationships.
    4. We cannot query from database.
  1. Trigger:
    1. It's a programmatic approach and event driven (insert, update, merge, delete). 
    2. Trigger works before and after some actions.
    3. Trigger works across all the objects.
    4. You can create a new record through trigger which is not possible through workflow.
    5. Triggers can be used for roll-up type scenarios where roll up summary fields cannot be used and also when a record needs to be created on a different object