6

Q1: When I change the owner of an Account record to UserA, the associated Opportunity record's owner is set to UserA automatically.

Is it a native behavior? (I checked all the workflows and account trigger code but I don't see any changes to opportunity.)

Q2: Follow the scenario of Q1, even though the opportunity owner is changed, the opportunity trigger is not fired. How is it possible? (I have debug log in my opportunity trigger I don't see the log printed).

I searched for existing questions and found this:https://success.salesforce.com/answers?id=90630000000gjvjAAA I'm not sure if this explains my question.

2
  • Did you change the account owner from the Account Detail Page? Are you sure you didn't select one of the option "Transfer open opportunities not owned by the existing account owner","Transfer closed opportunities"
    – brovasi
    Commented Jul 16, 2015 at 21:58
  • @brovasi Yes, I made change on Account detail page, I didn't check any of the checkboxes.
    – sfdcnoob
    Commented Jul 16, 2015 at 22:10

1 Answer 1

5

Q1 When I change the owner of an Account record to UserA, the associated Opportunity record's owner is set to UserA automatically.

Yes - this is by design

Q2 - even though the opportunity owner is changed, the opportunity trigger is not fired. How is it possible?

This is covered in the SFDC Help knowledge article

The Opportunity Workflows and triggers are NOT executed in the scenario where 
the Account owner is changed, which in turn changes Opportunity Owner.  
If you need the Opportunity logic to fire, 
you would need to call or include that logic in the Account trigger.
2
  • Hi crop, for the trigger on account, how do I write test code? The opportunity owner is changed by the system automatically
    – sfdcnoob
    Commented Jul 20, 2015 at 17:27
  • Jack -- This sounds like a different question to your original question - you should post a new question and demonstrate what you've done so far and where you are stuck. I'm sure the community can then help you out
    – cropredy
    Commented Jul 21, 2015 at 16:21

You must log in to answer this question.

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