0

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')

0

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'
3
  • 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 – Valentina Cordoba Silva Feb 16 at 19:34
  • Hello when I use the account table on the sub query this is the error i get – Valentina Cordoba Silva Feb 16 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 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.