Skip to main content
hi,

i have 3 objects, 

1.Batch

2.student

3.student batch junction

now,my requirement is- after a batch is completed(a checkbox is checked), no one candelete the record of Student related to that batch.

validation rute on junction objectI wrote a validation rule on Student batch junction-- (Batch__r.complted__c =true) && (  ISNULL(Student__r.Id ))

but it is not working
2 个回答
  1. 2019年10月20日 18:04
    hi Satya,

    following your option 1 i wrote a trigger

    trigger error_delete on Student_Batch_Junction__c (before delete) {

    for(Student_Batch_Junction__c d:Trigger.old){

    if(d.Batch__r.complted__c==true){

    d.adderror('cant be deleted');

    }

    }

    }

    but it is not working!! can you help me with this?

    ​​​​​​​