17

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..

1
  • 2
    triggers are more powerful because you are not restricted by any relationships, you can do an database update of any object in the org when the trigger fires. They do however ,require code and therefore need someone who understands Apex at a deeper level, and is able to create,deploy and maintain the code. Workflow rules, however are declarative, easier to implement and maintain.
    – akarnid
    Commented Feb 4, 2014 at 11:09

2 Answers 2

23

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.

1
  • Thank you so much, this is exactly what i was looking for.I should have phrased my question better, i was trying to understand the capabilities of workflows vs triggers in terms of cross object field updates.
    – user5352
    Commented Feb 5, 2014 at 9:03
0

In triggers, you can work on multiple objects. So in situations where you want to work on multiple objects simultaneously, you have to use triggers. If its on a single object, accomplish it with workflow.

As a developer, I will prefer workflow as far as possible, but again on the brighter side you have a lot of control through trigger.

PS: Good luck on your next attempt =)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .