Question
When using the 'Run an Apex Class' action, I get an error message stating 'Apex Class invalid'.
Answer
Recompiling your classes will solve this:
- Go to Salesforce Setup > Apex Classes
- At the Apex Classes main page, click Compile All Classes
To prevent this from happening again, enable compiling upon deploy:
- Go to Salesforce Setup > Apex Settings
- Enable Perform Synchronous Compile on Deploy
- Click Save