I have some code that automatically converts leads when certain conditions are met using the convertLead() method. This process is fairly well-documented in threads such as this:
and this works just fine for the most part. However, I'm noticing some strange behavior regarding the owner the newly created contact. For a brief moment in time, the owner of the contact that results from the lead being converted is the user that causes the trigger to fire rather than the owner of the lead.
Even more strangely, the contact eventually ends up being owned by the lead owner, but when before/after insert triggers and workflow rules fire on the Contact, the ownerid is the executing user.
I plan to open a case with support about this as well, but wondered if anyone had encountered anything like this or found a solution/workaround.