I'm getting this error "Invalid Bind expression type of Class_Detail__c for id field SObject Account"
Class_Detail__c.Student__c is a Master-Detail relationship field to Account. Basically I want to select a list of students from Account object using the ids (Student__c) from the Class_Detail__c custom object. What am I doing wrong?
id classid = lstOfPI.iClassID; id teacherid = lstOfPI.iTeacherid; List<Class_Detail__c> lstClass= [Select student__c from Class_Detail__c WHERE ClassID__c = :classid]; List<Account> lstStudentProfilesToUpdate = [SELECT Id,Teacher__c FROM Account WHERE id in :lstClass];