You need to sign in to do that
Don't have an account?

Need help with relationship Query..
Hi,
Is there a way to modify the following script to also include User?
SELECT Account.Name, Account.OwnerId, Name, Description, (SELECT Id, Quantity, PriceBookEntry.Product2.Name FROM OpportunityLineItems) FROM Opportunity
I need to access some User fields such as User.FirstName etc
Thanks for any hints
Sorry, I should have been more specific..
With the current script I can get: Account.OwnerId and Opportunity.OwnerId.
Since these fields have relationship with User.Id, I want to be able to access the User table in order to map a user name with a specific Account and Opportunity.
I hope this will make more sense
I'd recommend you try out some of the schema/query builder tools, they make this kinda stuff easy.
Thanks again,
Yes it is possible to access Account.Region__c, but I am afriad I can't se how this will help me access two custom fields in table User if I am using my original script above.
My task is to setup a scheduled batch job via the API using ASP.NET/C# and query a significant number of records.
Although the overall performance is not critical, I would really prefer to modify the original script to get my last two fields (rather than splitting it up..).
Thanks
Hi Simon,
Well, I got it wrong so many thanks for pointing me in the right direction!
I did read the documentation, but I admit I am bit of a novice to SOQL.