1

I need to load all accounts along with their owners' names, was trying next query:

SELECT Id, (SELECT FirstName, LastName FROM Owner), LastModifiedDate FROM Account

Got next error:

InvalidBatch : Failed to process query: INVALID_TYPE: (SELECT FirstName, LastName FROM Owner), LastModifiedDate FROM Account
^ ERROR at Row:1:Column:54 Didn't understand relationship 'Owner' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Did another try:

SELECT Id, Owner.FirstName, Owner.LastName, LastModifiedDate FROM Account

Got another error:

InvalidBatch : Failed to process query: FUNCTIONALITY_NOT_ENABLED: Foreign Key Relationships not supported in Bulk Query

How can I get owners (first name + last name) of accounts

3

I suggest you create formulas to pull in this information.

Owner_First_Name__c

Owner.FirstName

Owner_Last_Name__c

Owner.LastName

Now the Bulk API will support your query:

SELECT Id, Owner_First_Name__c, Owner_Last_Name__c LastModifiedDate FROM Account
| improve this answer | |

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.