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
Gadivemula Krishna 6Gadivemula Krishna 6 

Hi, what is Invalid loop variable type expected SObject was Account?

I am creating isExecuting Scenario. I had written trigger on Account and This is Helper class below... 
public class AccountNumberUpdate {
    public void checkUpdate()
     {
         if(Trigger.isExecuting)
         {
             for(Account accountRecordNew : Trigger.new)
             {
             for(Account acountRecordOld: Trigger.old)
             {
                if(acountRecordNew.id == acountRecordOld)
                   //logic
             }
         }
     }
     }
}
AnkaiahAnkaiah (Salesforce Developers) 
Hi Krishna,

Trigger.isExecuting is used in trigger not in the apex class.

Thanks!!
 
Gadivemula Krishna 6Gadivemula Krishna 6
Actually I am still having an same error called Invalid loop variable type expected SObject was Account?