function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
varma 116varma 116 

validation formula

Hi group,

 

             I have two s-obj (Male Teacher, Schedule), In Schedule s -obj I have a lookup field Male_Teacher__c ,Start_Date__c and End_Date__c.

            In a schedule s-obj,  I selected one male teacher(Mark) by using lookup button and filled start date and end date fields and save the record........

            So, my requirement is , in a Schedule s-obj if i select a same male teacher 'Mark'  in a same dates what i have entered in an above record, it  should throw an error "he is already allotted for these days",i.e., whenever a teacher is allotted for a particular date, a user should not be able to select the teacher.....

 pls send me formula for this requirement because iam new to salesfroce

    Thanks for giving reply (in advance)

  Thanks and Regards

       Varma

Jerun JoseJerun Jose
Hi Varma,

I dont think a validation rule will suffice in your case. You would need an apex trigger on the Schedule object to identify the working days of the teacher and then validate that against the input data.
varma 116varma 116

Thanks for giving reply

 

                can u pls eloberate , in the sense send me code for trigger according to my requirement..........

                    because iam new to salesforce.................

                             

 

             Thanks  and Reagards

                         Varma