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
JaxelJaxel 

Apex Classes Page Is Valid Column

Hi,
In the Setup/Develop/Apex Classes page, there's a column called 'Is Valid'. Most of my classes have a check on that column, but some of them don't and I'm trying to figure out what makes a class valid.

I have tests for most of my code too. Is there a certain percent coverage that needs to be achieved for a class in order to become valid?

Any insight on this will be appreciated.

Thanks!


Best Answer chosen by Admin (Salesforce Developers) 
Drew1815Drew1815
This is a snippet out of the standard salesforce.com help, under the section "Defining Apex Classes"


"
To aid backwards-compatibility, classes are stored with the specified version of the API that was used to compile them. Additionally, classes are stored with an isValid flag that is set to true as long as dependent metadata has not changed since the class was last compiled. If any changes are made to object names or fields that are used in the class, including superficial changes such as edits to an object or field description, or if changes are made to a class that calls this class, the isValid flag is set to false. When a trigger or Web service call invokes the class, the code is recompiled and the user is notified if there are any errors. If there are no errors, the isValid flag is reset to true."

All Answers

Drew1815Drew1815
This is a snippet out of the standard salesforce.com help, under the section "Defining Apex Classes"


"
To aid backwards-compatibility, classes are stored with the specified version of the API that was used to compile them. Additionally, classes are stored with an isValid flag that is set to true as long as dependent metadata has not changed since the class was last compiled. If any changes are made to object names or fields that are used in the class, including superficial changes such as edits to an object or field description, or if changes are made to a class that calls this class, the isValid flag is set to false. When a trigger or Web service call invokes the class, the code is recompiled and the user is notified if there are any errors. If there are no errors, the isValid flag is reset to true."
This was selected as the best answer
JaxelJaxel
I see, thank you!