I am trying to obtain all accounts names from the Accounts table that are also in the subquery that pulls organizations with Record type '012F0000001EsYbIAK' on dataloarder with SOQL

SELECT Name FROM Account WHERE Id IN (SELECT Id From Organization WHERE RecordTypeId = '012F0000001EsYbIAK')

1 Answer 1


Organization doesn't have Record Types on it; it is the record that defines the org you're logged in to. Some companies may rename Accounts to be called Organizations, but the actual Organization object never refers to an Account.

Most likely, you meant:

SELECT Name FROM Account WHERE RecordTypeId = '012F0000001EsYbIAK'
  • There has been an error in the SOQL query: MALFORMED_QUERY: WHERE Id IN (SELECT Name From Account WHERE RecordTypeId = '012F0000001EsYbIAK') ^ ERROR at Row:1:Column:56 The inner and outer selects should not be on the same object type Feb 16, 2021 at 19:34
  • Hello when I use the account table on the sub query this is the error i get Feb 16, 2021 at 19:35
  • You don't need the sub query. The query provided in the answer should get you names of all Account which fall in that or have that specific record type.
    – manjit5190
    Feb 16, 2021 at 19:54

You must log in to answer this question.

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