You need to sign in to do that
Don't have an account?
Admin_SF_TP
SOQL - filtering whole subquery to be not null
Hello,
I'm trying to filter a SOQL subquery (in the SELECT section) to be not null, but I hadn't had any luck so far.
The query:
SELECT (SELECT AccountId, ActivityDate, CreatedDate, CreatedById FROM OpenActivities WHERE ActivityDate = LAST_N_WEEKS:8 Order by ActivityDate desc) FROM Account
The query is showing some OpenActivies results, but far more null results that I don't need
Any ideas ?
I'm trying to filter a SOQL subquery (in the SELECT section) to be not null, but I hadn't had any luck so far.
The query:
SELECT (SELECT AccountId, ActivityDate, CreatedDate, CreatedById FROM OpenActivities WHERE ActivityDate = LAST_N_WEEKS:8 Order by ActivityDate desc) FROM Account
The query is showing some OpenActivies results, but far more null results that I don't need
Any ideas ?
In the newlist, you will get the desired results.
Please mark as solved if it helps. Thanks
All Answers
This will solve your problem.
When I started, I tried to execute the query not as a subquery, but the Force.com Explorer gave me an error, that the sObject type 'OpenActivities' is not supported. That's why I nested it as a subquery.
In the newlist, you will get the desired results.
Please mark as solved if it helps. Thanks
Yeah, that's kind the solution that I'm using right now. I was just wondering, if there was a way to filter out the Accounts, which doesn't have Open Activities, on SOQL-Level.
Getting the whole list and filter it in Java isn't the problem, but if there isn't a way doing it just with SOQL, I'll mark the workaround as solution.