You need to sign in to do that
Don't have an account?
RajeevlsHyd
Extract Owner ID details from Account
I want to extract ownerId and the user related details from Account , so writing the query :
SELECT Id,OwnerId,OwnerId__r.DefaultDivision FROM Account where Id in (....
Its giving error :
Didn't understand relationship 'OwnerId__r' in field path. 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.
Please suggest.
SELECT Id,OwnerId,OwnerId__r.DefaultDivision FROM Account where Id in (....
use below
SELECT Id,OwnerId,Owner.DefaultDivision FROM Account where Id in (....
All Answers
SELECT Id,OwnerId,OwnerId__r.DefaultDivision FROM Account where Id in (....
use below
SELECT Id,OwnerId,Owner.DefaultDivision FROM Account where Id in (....
same is applicable for all other standard lookup field.
for example in Contact object, AccountId is a standard field and related to Account. If you want to extract AccountId, name etc you can write below query.
Select Id, FirstName, AccountId, Account.Name, Account.AccountNumber From Contact
I hope this will help you to understand your problem.
Thanks dapanchal !!! Is there any way we can save query records from Developer Console?