• billg3
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I am trying to write an SOQL query to get followed opportunities but I get strange errors each time.

 

For example the following works:

  SELECT ParentId FROM EntitySubscriptions WHERE ParentId IN

    (SELECT ID FROM Opportunitiy) LIMIT 1000

 

but it returns me ID's which I would then need to make additional calls to get the opportunities

 

If I try the reverse:

  SELECT Id, Name, CloseDate FROM Opportunity WHERE Id IN

    (SELECT ParentId FROM EntitySubscriptions LIMIT 1000)

 

then I get complaints when I include the limit (expected right parenthesis) or I get complaints for not including the LIMIT.

 

Any ideas what I am doing wrong?

 

Thanks, Bill

  • March 20, 2012
  • Like
  • 0