function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
S MS M 

SOQL Query Help from OpportunityTeamMember

Account have Opportunities. Opportunities have OpportunityTeamMembers
Accounts also have Territory(Custom Object API Name = Territory_Lookup__c). Territory Object has a field called Geo.

I need to write a SOQL query from OpportunityTeamMembers to lookup the Account -> Its Territory and the Geo on the Territory

Select Id, TaxEntity__c, OpportunityId.AccountId.Territory_Lookup__r.Geo__c From OpportunityTeamMmeber

The component - OpportunityId.AccountId.Territory_Lookup__r.Geo__c is incorrect. Can you please suggest how to get this 
Shaijan ThomasShaijan Thomas
HI SM,

You have to write 2 seperate query to get the account id and Geo

Thanks
Shaijan Thomas