Workflows Vs Triggers

I recently took my Salesforce advanced admin certification (ADM211) and unfortunately i could not clear the exam, now i am planning to retake the exam.

There were quite a few questions which are scenario based, and the option would whether to go for workflow or trigger, i believe has answered these questions correctly, but still wanted to get some experts advice on workflows vs triggers before i retake my test again.

Workflows: You can create a workflow on child object and go down one level (Parent) in both criteria as well as field update action. Whereas if you select the Parent object, then you cant see the child object in the criteria or field update action. The reason why i am bringing this is because there were scenario based queries especially from Account to Oppty vice versa

In simple terms using workflow; you can go one level from child to Parent; if you want to make actions or criteria involving grand parent obj then you should go for triggers..

In triggers we have the flexibility of navigating from child to Parent (many levels) and Parent to Child object.

Can someone please confirm if my understanding is correct on workflows vs triggers.

Appreciate your response. It would be a great value add for me to take the retest.Trying to understand the limitations of workflows vs triggers..

Answer

Workflow

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
  • needed to kick off some apex code
  • many other reasons

Your post focuses on going from object to object, workflows are generally not good at that except for the above stated master detail scenario.

Attribution
Source : Link , Question Author : user5352 , Answer Author : MrNeatHawk

Leave a Comment