Activity › Forums › Salesforce® Discussions › What is the difference between Trigger and Workflow in salesforce?
-
What is the difference between Trigger and Workflow in salesforce?
Posted by Suraj on April 4, 2017 at 1:58 PMWhat is the difference between Trigger and Workflow?
William replied 7 years, 5 months ago 6 Members · 5 Replies -
5 Replies
-
Hi Suraj
Below are some points that helps you in differentiating between workflow and trigger
Workflow
- You cannot create records
They currently can only result in a task, email, field update, or outbound message
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 workflow
- We cannot query from database
Trigger
- Can do these things, but obviously using code.
Often needed for roll-up type scenarios where roll up summary fields cannot be used
Often needed when a record needs to be created on a different object - We can use 20 Dml operations in trigger
- Trigger can be used to invoke a webserive
Hope this may help you:
- You cannot create records
- [adinserter block='9']
-
Hi,
Basic Difference –
Workflow is automated process that fired an action based on Evaluation criteria and rule criteria. We can access a workflow across the object. Trigger is a piece of code that executes before or after a record is inserted or updated.
Hope this helps.
-
Adding some points:
Workflow
Workflow is automated process that fired an action based on Evaluation criteria and rule criteria.
We can access a workflow across the object.
We cannot perform DML operation on workflow
We cannot query from database
Trigger
Trigger is a piece of code that executes before or after a record is inserted or updated.
We can access the trigger across the object and related to that objects
We can use 20 DML operations in one trigger.
We can use 20 SOQL’s from data base in one trigger.
Thanks
-
Hello,
Workflow is a point and clicks Tool which doesn’t need coding. When you want to take actions like Update filed, Email, Outbound message, and create the task from the same object or from child to the parent object(in the master-detail relationship) you can use workflow. You can also perform these action based on time triggers. It’s an automated tool which fires based on Evaluation criteria and rule criteria. Using workflow you can’t create a record.
A trigger is a programmatic approach which fires when before or after a record is inserted, updated or deleted. Using a trigger you can work on multiple objects. It involves coding you can query and you can perform any DML operation.
Thanks.
-
Workflow: Workflow is automated process, a 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. You cannot perform DML operation on workflow. Workflows work only after some actions.
Trigger: Trigger is a programmatic code approach which fires when before or after a record is inserted, updated or deleted. Using trigger you can work on multiple objects. You can query and you can perform any DML operation. The trigger works before and after some actions.
Log In to reply.