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
chandu kumarchandu kumar 

trigger self reference error

Hi,

I have a scenario,that in account object there are two fields 1>status:checkbox
                                                                                       2>status range:process,final
i have wrote a trigger on on account object that when i checked the checkboxthe status range field shoud be complete otherwise incomplete. but if i try to update account records thetriggers are firing everytime. iwant to avoid it.how?
 
apex sfdevapex sfdev
You are operating on a same record and not using different objects, In such a case use formula field to update the range field like this,

if(status){
   status range='complete';
}

don't forget to deactivate the trigger.