Unlocked packages in Salesforce
Unlocked packages provide Salesforce teams a flexible way to manage and deploy modular metadata, especially for internal apps where admins need to edit directly in production. They combine upgrade paths with post-install customization, improving collaboration and reducing vendor dependency. The guide walks through enabling Dev Hub, using Salesforce CLI to create and version packages, and installing them across orgs. Best practices stress source control, namespace management, testing, and CI/CD for smooth deployment and upgrade management.
- Enable Dev Hub and 2GP to create unlocked packages using Salesforce CLI.
- Track local changes carefully as upgrades can overwrite direct modifications.
- Test new package versions thoroughly before deploying to production.
- Use source control tools and CI/CD pipelines to manage packaging and deployment.
- Limit namespaces to simplify upgrade paths unless absolutely necessary.
Unlocked packages in Salesforce offer a flexible way to manage and deploy metadata across multiple organizations. They are ideal for internal business applications, allowing administrators to modify metadata directly in production environments. This flexibility makes them particularly useful for companies that need to adapt quickly to changing business requirements. Here’s a detailed step-by-step guide on how to create and use unlocked packages. What Are Unlocked Packages? Flexibility : Unlike managed packages, unlocked packages allow you to add, edit, or remove metadata easily after installation. Modularity : They help build modular applications by organizing related components together. Upgradability : Unlike unmanaged packages, unlocked packages can be upgraded with new versions while preserving local changes made by users.