What are the differences between trigger and workflow in Salesforce?

DWQA QuestionsCategory: QuestionsWhat are the differences between trigger and workflow in Salesforce?
Editor Staff asked 1 month ago

What are the differences between trigger and workflow in Salesforce?

1 Answers
Editor Staff answered 1 month ago

Workflow
Trigger

Workflow is an automated process that fires an action depending on evaluation criteria and rule criteria
A trigger is a piece of program code that will be executed before or after a record has been inserted or updated

We cannot carry out DML operations on workflow
 We can use 20 DML operations in a single trigger

We are able to obtain a workflow across the object
We are able to access the trigger across the object and associated with that objects

We cannot query from database in workflow
We can use 20 SOQL(Salesforce Object Query Language) from the database in a single trigger