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
SriniSrini 

Opportunity Soql Query

Hi Team,

How to write a SOQL:   In opportunity Object we have Related lists like Teammembers and open activities.I want get the fields like Teammembers role = 'AB'  along with the open activities details from same opportunity .

Select id,Opportunity.RecordType.name,LastModifiedDate,Opportunity.LastModifiedDate,TeamMemberRole FROM OpportunityTeamMember where TeamMemberRole = 'ABC'

But i want to include openactivites fields  also. How to add this query from above one.

Please help us.


Thanks
sharathchandra thukkanisharathchandra thukkani
You can use below query

Select id,Opportunity.RecordType.name,LastModifiedDate,Opportunity.LastModifiedDate,TeamMemberRole,(SELECT Subject FROM OpenActivities) FROM OpportunityTeamMember where TeamMemberRole = 'ABC'