i wrote the trigger:
but its not workingtrigger Batch on Batch__c (after update) {
List<String> b= new List<String>();
for(Batch__c p: Trigger.new){
if(p.complted__c==true){
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]);
system.debug(c);
List<Student__c> s=new List<Student__c>([select Student__c.Name from Student__c]);
integer i=0;
for(Student__c o : s)
{ if(o.Name.equals(c))
{
o.Completed_Courses__c=o.Requested_Courses__c;
Update o;
}
}
}

Hi Agnibha,There are some few changes you should do on your code,and i've updated your code you can check below:(Note: it works if your relationship is master detail,and if it is not just change it.Hope it will work)
List<Student_Batch_Junction__c > c=new List<Student_Batch_Junction__c>([select Student.Idtrigger Batch on Batch__c (after update) {
List<String> b= new List<String>();
for(Batch__c p: Trigger.new){
if(p.complted__c==true){
b.add(p.Name);
} }
,Student__r.Name from Student_Batch_Junction__c where Batch__r.Name in :b]);
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.comSet<Id> allstudentBatchId=new Set<Id>();
for(Student_Batch_Junction__c stdjunction :c)
{
allstudentBatchId.add(stdjunction.Student.Id);
}
List<Student__c> s=new List<Student__c>([select Student__c.Name from Student__c where Id IN: allstudentBatchId]);
List<Student__c> updateStudent=new List<Student__c>();
for(Student__c stud : s)
{ if((stud.Name).equals(c))
{
stud.Completed_Courses__c=stud.Requested_Courses__c;
updateStudent.add(stud);
}
}
if(updateStudent.size()>0)
update updateStudent;
}
}