How to Choose to achive the Field Updates either using Workflow or Trigger:

Best practise to always use a workflow whenever possible and only use triggers when you cannot accomplish something using a standard workflow rule (field update).

here some few examples:

Master-detail Relationship:

1) Updating parent field value based on child field values (Workflow or Trigger)
Workflow Rule, because with master-detail relationship a child object we can update the parent object fields.

2) Updating child field value based on parent field values (Workflow or Trigger)
Apex Trigger, because you cannot update all children fields records from a workflow rule, no mater what the relationship is

Lookup Relationship:

3) Updating parent field value based on child field values (Workflow or Trigger)
Apex Trigger, because you can only update the parent fields record in a workflow rule if it is a master-detail relationship

4) Updating child field value based on parent field values (Workflow or Trigger)
Apex Trigger, because you cannot update all children fields records from a workflow rule, no mater what the relationship is

No Relationship Between Objects: (No Master-detail and No Lookup Relationship)

5) Updating parent field value based on child field values (Workflow or Trigger)
Apex Trigger, because without a relationship the workflow rule will not know which record to change

6) Updating child field value based on parent field values (Workflow or Trigger)
Apex Trigger, because without a relationship the workflow rule will not know which record to change

(939)

Written by 

I am Sakthivel Madesh, a certified Salesforce Developer & Administrator working on Salesforce Technology since 2011. I am currently working in IBM Austraila as Sr. Salesforce Developer. I have worked on multiple technologies Like PHP, Java, Salesforce, I am very passionate about Salesforce and to earn 9 Salesforce Certification. I love Trailhead for learning Salesforce Skill and Become a Trailhead Ranger too. I Love to Learn & Share my Salesforce knowledge to Salesforce Learners/Beginner using My Blog and Salesforce Community.

Leave a Reply