As you may know when you try to convert a lead ,during the execution of the lead convert ,the Account/Contact/Opportunity objects owner id's are set as the current user Id instead of the lead original owner id which can be problematic if you are programming your logic based on the correct owner id.
The Account/Contact/Opportunity owners are set to the original lead owner after conversion is finished (however I put debug statements in after lead update which is the last trigger running in conversion process, and Owner Id is still user Id. Where or when salesforce sets the correct owner id for those objects is a mystery to me)
Take a look at this post, and scroll down and see what sfdcfox says. Lead Conversion Trigger Order of Execution
The solution steps I came up with:
1 - I created a custom formula field named Lead_OwnerId_Custom__c on lead. The value of this field is Lead.OwnerId. Also I created a text field named Source_Lead_OwnerId__c on Account.
2 - Then I go to object management settings for leads, fields section, then I click on Map Lead Fields.
3- I map the Lead_OwnerId_Custom__c from Lead to Source_Lead_OwnerId__c on Account and hit save.
4- Now I try to convert a lead. I have written debug statements in before insert trigger for Account to show the Account.OwnerId and Account.Source_Lead_OwnerId__c.
Result: Account.OwnerId is set to current user id, which is wrong. But Account.Source_Lead_OwnerId__c has stayed as Lead original Owner Id which is correct and that's what I want.
So my question is, do you think this is a good work around for the original problem described above since I am relying on some undocumented feature of the language?