I am trying to query the converted Accounts field on Lead conversion, but always returns null. I tried to query these values in different SOQL and returns the value. since i do not want to write multiple queries, tried below:

List<Lead> convertedLeads= [
                SELECT Id, Name, ConvertedAccountId,
                    FROM Lead WHERE Id = :convertedLeadIdSet];

is it possible to query a above?

2 Answers 2


Yes, this is doable, you just need to use the correct relationshipname ConvertedAccount

select Id, ConvertedAccount.Owner.Name, ... from Lead

How did I find the relationshipname? - many ways, but Workbench is a typical route

enter image description here

  • I run the above query in workbench and it works. It returns null when this query executed in after update of Lead trigger.
    – goodForce
    Oct 27, 2017 at 13:28
  • @gold - you should edit your OP and post the essential bits of your after update trigger. What is the value of ConvertedAccountId in the after update trigger before the query executes? If null, then you are executing the query too soon in the sequence (that is, lead is not yet fully converted)
    – cropredy
    Oct 27, 2017 at 14:42
  • ConvertedAccountId have the accountId in afterUpdate trigger. also if i query the values in different SOQL i am getting values.
    – goodForce
    Oct 27, 2017 at 18:29
  • @gold - try using an future or queueable to do your querying
    – cropredy
    Oct 27, 2017 at 18:42
  • definitely it would work in future or queueable.
    – goodForce
    Oct 27, 2017 at 19:01

I have queried the same fields in the future method and it worked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .