I'm trying to do the query :
List<Scholars__c> scholList = [SELECT Id, Name, Balance_Amount__c, ContactId__c, Student_Name__r.Id, Student_Name__r.Name FROM Scholars__c WHERE Student_Name__r.Id IN (SELECT Recipient__c FROM Report_Item__c WHERE Donation_name__c =: recordId AND Report_Document__c=:reportDocId)];
I getting the error :
The left operand cannot have more than one level of relationships
I tried to use a custom field named "ContactId__c" which I fill the Id of the Student, but then I get the error :
The left operand field in the where expression for outer query should be an id field, cannot use: 'ContactId__c'
What else can I try to achieve that?