Good day Everyone. My question is a follow up question for my first problem which is already answered here. This is the link of my first question Use Object from another manage Package without making my own package dependent to it. As what our mates here suggested my first problem can be solve using dynamic SObject and dynamic SOQL. My question is that, If I did some code that will make my managed package dependent to "Package B", can I remove the dependency by removing the part of the code that makes it dependent ? or once it is dependent it will always be dependent even if I remove some part of the code ? Thank you.
if you release a package which is dependent on package B then you cannot remove that dependency easily. You have to connect to salesforce to remove that dependency.
It may be possible if you roll back the version that caused the dependency to a beta package. This is only allowed if no subscribers have that version or later installed. You'll also need to create a case with support. Simply removing the component that caused the dependency to be created will not remove the dependency. This is why it is incredibly important that you take care not to create these dependencies in the first place.