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
Anu Raj.ax1269Anu Raj.ax1269 

Variable not found in test class

Hi,

 

 

I have created a test class because i have to use the same set of record repeat, so i created a static method and have same record in it and defined the object in class"
public Account a;". But when i try to access this object in my static method i am getting error that variable not found. Any body here can help me out.

 

thanks

 

bob_buzzardbob_buzzard

Static methods can't see instance variables - if 'a' needs to be accessible from static methods it needs to be static itself:

 

public static Account a;