Skip to main content
Hello I want to write a SOQL query but want to bring the account name and also the End User Name I cannot get the SOQL to work.

 

Can somebody help:

 

SELECT LastModifiedDate, Quantity, TotalPrice, Opportunity.AccountId, Opportunity.Billing_Country__c, Opportunity.CloseDate, Opportunity.End_User__r.name, Opportunity.LastActivityDate, Opportunity.Opportunity_reference__c, Opportunity.Probability, Product2.Family, Product2.Name FROM OpportunityLineItem 
2 respostas
  1. 9 de nov. de 2018, 15:38
    Hi Jonathan - by enduser, are you refering to the owner? if so this is the query (add any account and user fields as you require):

     

    select name, account.owner.name from account

     

    as you can see you can traverse the lookup to user by using account.<lookup name>.<field on target object>
0/9000