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

error:::maximum trigger depth exceeded

hi All,
i am getting 'maximum trigger depth exceeded' error while inserting new account through trigger.
i am using developer account.
cud anybody help me out?
Post your trigger code...
this is trigger code::
trigger test_createacc on Account (before insert) {
account aa= new account(name='xxx', sla__c='gold',,Active__c='yes',SLASerialNumber__c='11');
insert aa;
Your Account trigger is creating a new Account, which is firing the Account trigger again. You're essentially in an infinite loop, and Apex kicks you out. I'm not sure what you're trying to do with your code, but if you have a trigger that is modifying the same object that you're triggering on, you have to be careful not to get into these kinds of loops.
thanks a lot :)
actually i m new to playing with it.