• Biju Narayanan
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi 

I have a requirement to update some fields of an account based ont he Account Owner Ids. The process should be

1. Write Trigger in the Account Update
2. Check if the Owner is updated 
3. Check if a specific Id is common for both Old/New Owners (Select PGroupId, Id from user where id in (OldOwnerId,NewOwnerId)
4. If group id is same for both owners update specific fields in the account.

I have started coding in the Trigger. Since these changes are happening from the ETL process, I  am not sure how to bulkify my code. Should I get all the Account Ids before starting the Trigger & Compare in the below trigger ? Any suggestions
for (Account acc: Trigger.new) {
}

Thanks
Biju