I tried to access student in this way..it is showing errortrigger Batch on Batch__c (before insert,after update) {
List<String> b= new List<String>();
for(Batch__c p: Trigger.new){
b.add(p.Name);
}
List<Student__c> c=new List<Student__c>([select Student__r.Name from Student_Batch_Junction__c where Batch__r.Name in :b]);
}
6 Antworten

Hi Agnibha, Please check below code:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.Thanks and Regards,Deepali Kulshresthawww.kdeepali.comtrigger Batch on Batch__c (before insert,after update) {
List<String> b= new List<String>();
for(Batch__c p: Trigger.new){
b.add(p.Name);
}
List<Student_Batch_Junction__c > c=new List<Student_Batch_Junction__c>([select Student__r.Name from Student_Batch_Junction__c where Batch__r.Name in :b]);
}