You need to sign in to do that
Don't have an account?
manuvbkk
System.VisualforceException : Dependent class is invalid and needs recompilation
This error seems to be an odd one in that seems to happen when loading a visualforce page first time each day. This page is accessed from a community portal. Subsequent attempts to access the page loads fine, its only the first time each day that we have noticed this.
We tried saving the class here but there are no compilation errors.
Anyone faced seomthing like this before?
System.VisualforceException : Dependent class is invalid and needs recompilation: Class ClassName : SELECT AccountId, Account.RecordType.Name FROM User ^ERROR at Row:1:Column:19Didn't understand relationship 'Account' in field path.
We tried saving the class here but there are no compilation errors.
Anyone faced seomthing like this before?
In Classic
Go to Setup -> Develop -> Apex Classes -> Then Click on "Compile all classes" link.
In Lightening
Go to Setup -> Custom Code -> Apex Classes -> Then Click on "Compile all classes" link.
This will give you error detail about the classes which are failing, Once its done save your code.
Here two reason may be:-
Solution 1:-
- Class1 : method calls the method from class2
- Class2 : method calls the method from class1
- Both classes are depandant on Class3.
- Now if I add a variable in Class3 which are used both in Class1 and 2.
- Then in class1 comment the code where class2 method is called do changes and save. Then make changes in class2, save it. Finally uncomment the method call in class1.
- If its not done then this error will be thrown.
Solution 2:- This errors means that the classes and triggers need to be compiled in your Org.1. To compile Classes go to: Setup>> Develop >> Apex Classes
Click "Compile all classes" Link
2. To compile Triggers go to: Setup>> Develop >> Apex Triggers
Click "Compile all triggers" Link
Follow above process to solve you issue.
Please MARK AS A BEST ANSWER!!!!
Regards
Mukesh