You need to sign in to do that
Don't have an account?
Task Subquery
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?
=============================
Developer for www.voicent.com
Voicent provides CRM, auto dialer, predictive dialer, reminder, and call center solution that is suitable for anyone in any level
Voicent strives to meet customer demands to integrate Voicent software with CRM of their choice.
Hi. Just answering in case someone came here now.
to subquery task in account do this:
SELECT id, (SELECT id FROM tasks) FROM account
Note the 's' at the end of 'task'
https://developer.salesforce.com/docs/atlas.en-us.236.0.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_query_using.htm