• Switch
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I am trying to loop through a list of team members on an opportunity and am having troubles. Here's the piece that isn't working how I need it to:

 

        for (Opportunity opp : tNewMap.values()) {

 

//This code section works, but obviously really bad for bulk loads

                List<OpportunityTeamMember> oppMembers = [SELECT UserId FROM OpportunityTeamMember WHERE OpportunityId =: opp.Id];      
                for (OpportunityTeamMember otm : oppMembers) {

 

 

//This doesn't work and I'm not sure why
                for (OpportunityTeamMember otm : opp.OpportunityTeamMembers) {

 

 

Any advice?

  • February 07, 2011
  • Like
  • 0