function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
GoForceGoGoForceGo 

Lead Conversion - Owner Change - How to Tell in Trigger?

When a lead is converted, you can specify the new owner of the account/contact.in UI.

 

I am trying to detect if this is happening in a trigger. In the after update trigger on lead, the owner of the created contact is the same as that of the lead. 

So I thought perhaps the contact ownership change is being done AFTER lead is updated. I wrote a separate after update  trigger on contact to see if the ownership change. It doesn't change there either.

 

The final contact owner indeed is the new owner, but no triggers seem to detect it.


Turns out orgs provisioned in past (perhaps 2008 and earlier) don't have this issue (the ones where Leads->Settings->Enforce Validation and Triggers from Lead Convert option does not exist). In newer orgs, it makes no difference if I turn on this flag or turn it off. 

 

What is going on?

 

 

bob_buzzardbob_buzzard

Nothing helpful to add apart from I see exactly this behaviour too.  I've got some code that pulls information from the owner record into the converted account/contact.  I tend to either advise the customer to change ownership after the contact/account is created, or have a batch job that runs on the new records.

bhuyadavbhuyadav

Hi Guys,

 

I also went through the same situation where if I cnage the owner at the  time of conversion then there  is nothing as such in trigger which tells us the new owner. However conversion takes place in proper manner with proper owner assigned at the end.

 

My requirement was to perform some action on the basis of new owner of converted opportunity. I contacted salesforce support and there response was to use FUTURE METHOD call.

 

Although My problem got solved through Future method call.