New Feature

Destructive Changes in Salesforce

Blue Canvas can help you do destructive changes in Salesforce. Here is how you can remove Apex Classes and other metadata types automatically.

August 2, 2017

Are there fields or metadata components in your Salesforce orgs that you no longer need? Is all of your code being used by your end-users? For many the answer is “probably not”. After years on the Salesforce platform, many organizations have seen the build up of unused code on their Salesforce orgs and are working to clean things up. Having unused code in your application is a real cost from a performance and developer workflow perspective. Unused code will slow you down in both the speed of your application and the speed of your developers in their ability to improve the application. Regularly cleaning up unused code is a good thing to do.

Unfortunately, Salesforce does not make it very easy to remove code. Destructive changes in Salesforce are just a pain. You can’t make destructive changes with Change Sets. You have to use the migration tool. That requires some specific domain knowledge and the setup and maintenance costs associated with running the Ant migration tool. And even if you are an expert with Ant and XML scripting, the tool isn’t always reliable for destructive changes.

Blue Canvas allows you to do destructive changes easily. Simply compare to branches. Items that are red will be deleted.

Blue Canvas then generates the destructiveChanges.xml and deploys the destructive change automatically.

Generally, when you run a destructiveChanges.xml script and delete fields, you cannot undo what you have done. Deletions are permanent. This can make deleting fields a bit scary and it’s a big part of why teams are so hesitant to do it. And this is why we see so many massive Salesforce projects with code from 8 or 9 years ago that no one is willing to delete because they don’t have the confidence to know that what they are deleting won’t cause dependency issues with their more recent code.

With Blue Canvas everything is tracked in Git, nothing is permanently deleted. You always have a backup of everything that you delete in you Salesforce orgs. This gives you the confidence to delete old fields and types without worrying about never being able to restore them again.

Delete your unused code now! Just use Blue Canvas to make it easy and safe with automatic backup in case you delete something you wish you didn’t.

More like this