5

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.

  • 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" – Cloud Ninja Jul 16 '15 at 21:58
  • @brovasi Yes, I made change on Account detail page, I didn't check any of the checkboxes. – sfdcnoob Jul 16 '15 at 22:10
4

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.
  • Hi crop, for the trigger on account, how do I write test code? The opportunity owner is changed by the system automatically – sfdcnoob Jul 20 '15 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 Jul 21 '15 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.