You need to sign in to do that
Don't have an account?

SOQL Query Condition for nested relationship
Hi everybody,
maybe some one of you guys can help with this problem. I try to query all records from the WorkflowStep__c object where User = system.getUserInfo.getUserID() or the current user has an entry in the WorkflowResourceMember__c object
I tried the following query:
wsteplist = [
select
id,
Name
from WorkflowStep__c
where ShowInList__c = 'Open' AND
(User__c =: system.UserInfo.getUserId() OR
Ressource__c IN (select WorkflowResource__c from WorkflowResourceMember__c where Memeber__c =: system.UserInfo.getUserId() ) )
];
but returned error:
Error: Compile Error: Semi join sub-selects are only allowed at the top level WHERE expressions and not in nested WHERE expressions. at line 7 column 21
I really appreciate your help
Cheers
Sebastian
Hi Sebastian,
your sub query is simply not possible in SOQL (though it is in SQL).
I suppose you have to break it to two sub queries and usesome apex processing in between.
David.
All Answers
Hi Sebastian,
your sub query is simply not possible in SOQL (though it is in SQL).
I suppose you have to break it to two sub queries and usesome apex processing in between.
David.
Thanks David.
Could you please send me the reson behid this. If you send me some referal link that will be great.
Thanks!