I have made some changes in an Org1 and trying to move those changes to Org2.

Some classes are changed and some newly added.

The classes are compilable in Org1.

These classes have interdependency.

For example class A is dependent on class B.

Class B is dependent on class A.

I can not save any class independently so I tried to use File->Save All from Developer console.

But getting error:

Dependent class is invalid and needs recompilation:

How can we save multiple classes with inter dependency in Salesforce?

  • 1
    why not use changeset to move from org1 to org2? – cropredy Mar 13 '19 at 16:27

That should generally work if the files are all saved at once. However, if that's not working, you may want to use an IDE, SFDX, or the Ant Migration Toolkit to deploy all changes at once. As long as all dependencies are satisfied in a single deployment, everything should go through just fine. This presumes that A and B both compile with any other common dependencies (e.g. C) and with regards to each other.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.