Workflow and triggers perform the same basic actions, but have weighted benefits:
Workflow is point-and-click, no coding required functionality that can update fields on a record, set reminder tasks, send emails, notify explicitly programmed (WSDL-based) external systems of updates, and do any of the above in a time-delayed fashion. It can't update or access arbitarily unrelated records, access children records, use REST or arbitrary SOAP/XML based services, perform encryption or decryption of text, and other complex problems that require coding.
Triggers is coding-only, DML-activated functionality that can insert, update, and delete any related or unrelated record in a transaction, send custom emails not derived of templates, access REST, XML, and SOAP-based external services, encrypt and decrypt text, and perform complex mathematical problems using far more power than workflows can manage. Notably, however, they cannot be time-delayed directly like a workflow rule can, but you can trigger the code by using a workflow field update on a time-based rule.
Add to that, in trigger u can perform 'Before, After (insert,delete, update, upsert, undelete) with 'old' and 'new' by using trigger context variables like ( trigger.isInsert) etc.
Please refer below blog from Shashikant Sharma,
http://forceschool.blogspot.in/2011/05/hi-all-triggers-are-very-essential-in.html
Thanks,
Devendra
All Answers
Please refer below blog from Shashikant Sharma,
http://forceschool.blogspot.in/2011/05/hi-all-triggers-are-very-essential-in.html
Thanks,
Devendra
Workflow and triggers perform the same basic actions, but have weighted benefits:
Workflow is point-and-click, no coding required functionality that can update fields on a record, set reminder tasks, send emails, notify explicitly programmed (WSDL-based) external systems of updates, and do any of the above in a time-delayed fashion. It can't update or access arbitarily unrelated records, access children records, use REST or arbitrary SOAP/XML based services, perform encryption or decryption of text, and other complex problems that require coding.
Triggers is coding-only, DML-activated functionality that can insert, update, and delete any related or unrelated record in a transaction, send custom emails not derived of templates, access REST, XML, and SOAP-based external services, encrypt and decrypt text, and perform complex mathematical problems using far more power than workflows can manage. Notably, however, they cannot be time-delayed directly like a workflow rule can, but you can trigger the code by using a workflow field update on a time-based rule.
Sfdcfox,
Excellent..Explanation really helps..!
Thanks,
Devendra
Thanks... Devendra.
It is very good answer.
Thanks...... sfdcfox.
Add to that, in trigger u can perform 'Before, After (insert,delete, update, upsert, undelete) with 'old' and 'new' by using trigger context variables like ( trigger.isInsert) etc.