Automatically identify dependencies in Apex classes and triggers
Ellis Toms on May 30th 2018
Missing dependencies are one of the greatest pain points for Salesforce admins and developers - they block deployments, take hours to track down, and can involve a lot of manual XML editing. Gearset's problem analyzers scan your metadata and automatically identify and resolve these missing dependencies for you, making deployments a breeze.
With our latest update, Gearset now understands and resolves dependencies within Apex classes and triggers. Referencing a new object in your Apex class? We'll spot it and make sure it gets included in your release. Does that new object have related profile and field level security changes? You can include those with just a click. The result is faster, smoother deployments and happier end users.
Deploying Apex classes with dependencies
When configuring your deployment, Gearset automatically identifies references to standard and custom objects and fields, and other Apex classes in your source code. This means you'll be able to clearly see what dependencies you need to include, and select them with a click of a button. But if you do forget any dependencies, Gearset's got your back and will prompt you to add them to your package pre-deployment.
In the example below, we’ve selected an Apex class and intentionally not included its dependencies. Without Gearset’s dependency analysis, and in most deployment tools, this would cause the deployment to fail.
This is where Gearset really kicks into gear. Before you push anything to Salesforce for validation, Gearset scans your selected components for any missing dependencies and will suggest any changes you'll need to make to ensure your release goes smoothly. In this case, you can see it's picked up our missing custom objects and fields, and suggested we include them in order to deploy successfully.
With Gearset's dependency tracking at your side, you'll be able to deploy your Apex classes and their dependencies with just a few clicks, eliminating the trial-and-error from your Salesforce deployments once and for all.
More Apex dependencies coming soon
This is just the start for our Apex dependency analysis. Over time we'll be making Gearset even smarter to include more complex dependencies in your Apex, including references embedded in DML operations and SOQL queries. Keep your eyes peeled for more updates in our change log for more information!
Have feedback? We want to hear from you!
If you have any feedback or suggestions on how we can make our Apex dependency tracking even greater (or any other feature for that matter), then we want to know! You can get in touch via the live in-app chat or at [email protected].