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
Prince VenkatPrince Venkat 

Checkbox Field


Do not allow if the Student(object Name) is trying to update the Participated checkbox to 'true' after the activity end date.

For example :- if activity end date is 4th may 2020 then do not allow user to update the Participated checkbox field to true on 5th may 2020

Hii Prince venkat
Try below Code
trigger testtrigger on Student__c(Before Update) {
        for(Student__c con :{ 
           if(con.checkbox__c == true && con.End_date__c >{
            con.checkbox__c.AddError('checkbox can't be checked');
Please Mark It As Best Answer If It Helps
Thank You!