When I validate a change set with RunLocalTests in production (as well as using the CLI with that flag for CI/CD and packaging integration) there was a class that was erroring out as a dependency. I've deleted the class from production since it was no longer needed. Using workbench was easy to delete the class. Now I'm still getting the same error with RunLocalTests

Dependent class is invalid and needs recompilation

I think the solution is to use Compile all classes in production but I'm afraid of causing working classes to fail. Would you please let me know what are potential issues if use this method of recompiling all classes in prod?

  • @KrisGoncalves I was just going through that page. Unfortunately, it doesn't answer my question of whether clicking "Compile all classes" can cause working classes to fail for any particular reason?
    – Bahman.A
    Apr 12 at 18:34
  • 2
    Basically same question from yesterday (from someone else). There is no risk with Compile All Classes, but it likely won't fix your problem, either. You need to fix the missing dependencies in your Change Set.
    – sfdcfox
    Apr 12 at 18:42
  • @sfdcfox Would you recommend me to delete this question? or do you think leaving it as is would possibly be helpful in terms of routing people to the correct answer on the linked post?
    – Bahman.A
    Apr 12 at 19:07
  • 1
    Feel free to leave it; that's what the duplicate system is there for.
    – sfdcfox
    Apr 12 at 19:22
  • @sfdcfox Thanks for the extra tip!! "Compile all classes" didn't fix the issue. I did have to find all references and fix them manually. I thought I'd done it but there were more which I didn't see the first time.
    – Bahman.A
    Apr 12 at 19:53