• Charleston Parapinski
  • NEWBIE
  • 0 Points
  • Member since 2022

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

Is it possible to subquery tasks?  I'd like to pull accounts that do not have an open task.

 

This is what I have:

 

for(account a: [select id, Name, ownerid, lastactivitydate FROM ACCOUNT WHERE ID IN (SELECT ACCOUNTID FROM task WHERE STATUS != 'NOT STARTED') AND lastactivitydate <:lastedit AND type = 'Active Opportunity' AND LastModifiedDate <:lastedit and ownerID !=: userinfo.getuserid() and LASTACTIVITYDATE!= NULL ORDER BY LastActivityDate Desc limit 150]) {
accountlist.add(new aAccount(a));
}

 

I am throwing this error:

Compile Error: Entity 'task' is not supported for semi join inner selects at line 35 column 24

 

Is there another way to pull all accounts that do not have an open task?