Skip to main content
Tweeted twitter.com/#!/StackSalesforce/status/636540557196718080
deleted 1 character in body
Source Link
Benj
  • 11.3k
  • 9
  • 67
  • 121

I would like to retrieve the list of Opportunities which have at least one OpportunityContactRole with role equal to test

Right now, I am doing the below query but it retrieves all the rows in the opportunity table..

[SELECT Id,
    (SELECT Id FROM OpportunityContactRoles WHERE Role = 'test')
FROM Opportunity 
WHERE IsClosed = TRUE AND IsWon = TRUE)];TRUE];

Is there any better alternative for this??

I would like to retrieve the list of Opportunities which have at least one OpportunityContactRole with role equal to test

Right now, I am doing the below query but it retrieves all the rows in the opportunity table..

[SELECT Id,
    (SELECT Id FROM OpportunityContactRoles WHERE Role = 'test')
FROM Opportunity 
WHERE IsClosed = TRUE AND IsWon = TRUE)];

Is there any better alternative for this??

I would like to retrieve the list of Opportunities which have at least one OpportunityContactRole with role equal to test

Right now, I am doing the below query but it retrieves all the rows in the opportunity table..

[SELECT Id,
    (SELECT Id FROM OpportunityContactRoles WHERE Role = 'test')
FROM Opportunity 
WHERE IsClosed = TRUE AND IsWon = TRUE];

Is there any better alternative for this??

added 21 characters in body
Source Link
Benj
  • 11.3k
  • 9
  • 67
  • 121

I would like to retrieve the list of Opportunities which have at least one OpportunityContactRole with role equal to test

Right now, I am doing the below query but it retrieves all the rows in the opportunity table..

[SELECT Id,
    (SELECT Id FROM OpportunityContactRoles WHERE Role = 'test')  
FROM Opportunity  
WHERE IsClosed = TRUE AND IsWon = TRUE)];

Is there any better alternative for this??

I would like to retrieve the list of Opportunities which have at least one OpportunityContactRole with role equal to test

Right now, I am doing the below query but it retrieves all the rows in the opportunity table..

[SELECT Id,(SELECT Id FROM OpportunityContactRoles WHERE Role = 'test') FROM Opportunity WHERE IsClosed = TRUE AND IsWon = TRUE)];

Is there any better alternative for this??

I would like to retrieve the list of Opportunities which have at least one OpportunityContactRole with role equal to test

Right now, I am doing the below query but it retrieves all the rows in the opportunity table..

[SELECT Id,
    (SELECT Id FROM OpportunityContactRoles WHERE Role = 'test') 
FROM Opportunity  
WHERE IsClosed = TRUE AND IsWon = TRUE)];

Is there any better alternative for this??

Source Link
javanoob
  • 9k
  • 15
  • 77
  • 143

How to get List of Opportunities with condition on OpportunityContactRole?

I would like to retrieve the list of Opportunities which have at least one OpportunityContactRole with role equal to test

Right now, I am doing the below query but it retrieves all the rows in the opportunity table..

[SELECT Id,(SELECT Id FROM OpportunityContactRoles WHERE Role = 'test') FROM Opportunity WHERE IsClosed = TRUE AND IsWon = TRUE)];

Is there any better alternative for this??