My code is:
trigger ClassCustomStatus on Class__c (before update) {
Set<Id> classSet = new Set<Id>();
for(Class__c c : Trigger.new){
if(c.Custom_Status__c == 'Reset'){
classSet.add(c.Id);
}
}
list<student__C> s = [SELECT id FROM Student__c WHERE class__c IN:classSet];
Delete s;
}
Here I am getting one exception this:
How can delete child records which are from student__c And How can I update a field of parent which is Class__c Please help
NumberOfStudents
a Roll-Up Summary Field from Students to Class?