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

lead trigger question

I have a before update trigger on leads that creates a parent account and automatically assigns it to the converted account. This works fine.

We are adding code that will set the owner of the parent account to the user listed on the lead convert window.

The problem I am seeing is that where all the other records that are created during lead convert (opportunity, contact, account, task) are getting the new record owner  as set in the lead convert window, the parent account is getting set to current user.

What would be causing this? Is it a timing issue?


It is a very normal SFDC feature , if you don't set the owner of the record at the time of creation by default the current/running user is set as the owner of the record created.


So the user selected in the Lead Convert window is not related to the PArent Account that being created from your Trigger.


If that is you business requirement to get that user and set as Owner for the Parent Account we need to capture the User selected in the Lead Convert window and explicitly set the user as the owner in the trigger code.


Thanks and Regards,

Dinesh Nasipuri


That's just it. We are capturing the record owner change in the Lead Convert window with standard salesforce functionality.


So at the time the convert button is pushed, the record owner has been changed in the lead convert window.


In the trigger, which is an after update trigger, I am trying to grab that new record owner, but it is the current user.


When will that record owner become the new record owner as stated in the lead convert window?