
Create a scratch org definition file, or an external.json file, that specifies the features and org settings required for the metadata in your package. Then from your local Salesforce DX project directory, create the package using the force:package:create Salesforce CLI command. Only run this command once for each package you create.
- Create the package: From Setup, enter Packages in the Quick Find box, then select Packages. Click New. Fill in the details of the package. ...
- Add the necessary components for your app. Click Add Components. From the drop-down list, choose the type of component. ...
- Click Upload.
What is a package in Salesforce?
A package is a top-level container that holds important details about the app or package: the package name, description, and associated namespace. You supply the package details when you create a package using Salesforce CLI, and the package descriptor section of your sfdx-project.json project configuration file is automatically updated.
How do I uninstall a package in Salesforce?
To uninstall a first-generation package, use the Salesforce user interface. Specify the package ID for a second-generation package. To list the org’s installed packages, run "sfdx force:package:installed:list". To uninstall a first-generation package, from Setup, enter Installed Packages in the Quick Find box, then select Installed Packages.
How do I create a package in package manager?
From Setup, enter Package Manager in the Quick Find box, then select Package Manager. Click New. Enter a name for your package. You can use a different name than what appears on AppExchange.
How do I import an XML file into a Salesforce project?
Click File > Save. Once the XML file is ready, it should look something like this: The next step is to pull the existing metadata out of the org and into the project by using the package.xml file created in the previous step and a Salesforce CLI command.

What are packages in Salesforce?
A package is a container for something as small as an individual component or as large as a set of related apps. After creating a package, you can distribute it to other Salesforce users and organizations, including those outside your company.
How do I use Salesforce packages?
To modify the default settings:Determine your package access settings. Click View Components. You'll see an overlay with a list of components in the package. ... Click Install. You'll see a message that describes the progress and a confirmation message after the installation is complete.
How do I create a community package in Salesforce?
Create a package to upload your app or Lightning component to AppExchange or to deploy changes between orgs. From Setup, enter Package Manager in the Quick Find box, then select Package Manager. Click New. Enter a name for your package.
How do I deploy a package in Salesforce?
In a browser, go to the installation URL provided by the package developer, or, if you're installing a package from AppExchange, click Get It Now from the application information page. Enter your username and password for the Salesforce organization in which you want to install the package, and then click Log In.
What are types of packages in Salesforce?
Types of package in SalesforceFirst-Generation Packaging.Second-Generation Packaging.Difference between unmanaged packages, managed packaged and unlocked packages.Create Unlocked package.Create a package version.Publishing and Installing Unlocked packages.
How many types of packages are there in Salesforce?
There are two kinds of packages - managed and unmanaged. How do they differ from each other? Salesforce managed packages are created by Salesforce partners to distribute and sell apps to their customers.
How do I create a managed package?
The only requirement to create a managed package is that you're using a Developer Edition organization....If you're uploading a beta package for testing, see Creating and Uploading a Beta Package.Create a package: ... Optionally, change the API access privileges. ... Add the necessary components for your app.More items...
How do I create an unlocked package in Salesforce?
From Setup in your Trailhead Playground, enter Dev Hub in the Quick Find box and select Dev Hub. Click Enable Dev Hub and then click Enable Unlocked Packages and Second-Generation Managed Packages. Create a GitHub account, if you don't already have one. Install Salesforce CLI on your computer.
Can you package a community Salesforce?
Any internal user with the necessary permissions can install the Salesforce Communities Management package, as long as Salesforce Communities is enabled in your Salesforce org.
How do I create a managed package in Salesforce?
Before creating managed packages, here are a few things to consider:You must use a Developer Edition organization to create and work with a managed package. ... Before converting an unmanaged package to managed, enable your organization to create managed packages.More items...
How do I create a deployment package?
To create a software updates deployment packageSet up a connection to the SMS Provider.Create the new package object by using the SMS_SoftwareUpdatesPackage class.Populate the new package properties.Save the new package and properties.
How do I deploy a package XML in Salesforce?
To perform a Deploy operation (Upload changes from the configuration data to Salesforce):Create a folder the package XML file in the root and a sub level folder with the component name.Zip the folder.Visit the Workbench site and login with username and password, if not already logged in.Click the Migration tab.More items...
Standard Objects
This sample package.xml manifest file illustrates how to work with the standard Account object. Retrieving or deploying a standard object includes all custom and standard fields except for standard fields that aren’t customizable. All custom fields are supported.
All Custom Objects
This sample package.xml manifest file illustrates how to work with all custom objects.
Standard Picklist Fields
In API version 38.0 and later, the StandardValueSet type represents standard picklists. Picklists are no longer represented by fields as in earlier versions. This sample package.xml represents the Industry standard picklist as a StandardValueSet type.
Custom and Standard Fields
This sample package.xml manifest file illustrates how to work with custom fields in custom and standard objects and standard fields in a standard object.
List Views for Standard Objects
The easiest way to retrieve list views for a standard object is to retrieve the object. The list views are included in the retrieved component. See Standard Objects.
Packages
To retrieve a package, set the name of the package in the packageNames field in RetrieveRequest when you call retrieve (). The package.xml manifest file is automatically populated in the retrieved .zip file. The <fullName > element in package.xml contains the name of the retrieved package.
Security Settings
This sample package.xml manifest file illustrates how to work with an organization’s security settings. You specify Security in the <members > element and Settings in the name element when retrieving the SecuritySettings component type.
Why We Love Package Development
We think packaging is one of the most exciting features for Salesforce Platform developers. It’s on par with some well-known disruptive innovations, such as sliced bread, the mobile phone, and video streaming services. But just in case you need more convincing, let’s sum up the key benefits that we’ve learned so far. Package development:
Configure Your Environment
Before you can get to the good stuff, let’s set up a new Trailhead Playground and enable the Dev Hub and packaging in it.
Create the Package
When you cloned the DreamHouse LWC app from GitHub, you pulled all the source files into your project directory. You can now create the base package without further fanfare.
Create a Scratch Org to Test Your Package Version
Let’s create a scratch org, in which to install the unlocked package, with the alias MyScratchOrg. Testing in a scratch org is a convenient way to perform the unit testing phase of the packaging development lifecycle.
Create the Package Version and Install It in Your Scratch Org
When you’re ready to release the package, you create a snapshot of it, called a package version. Installing the package version is similar to deploying metadata. Remember, once created, a package version serves as an immutable artifact containing a specific set of metadata.
Release the Package Version
One feature we haven’t discussed yet is package status. Packages have beta status when you initially create them. You can’t install beta packages in a production org. This is a safeguard to make sure the package version you release is production ready.
Install the Package Version in an Org
Last but not least, install the package version in your org. Remember, you can install beta package versions in scratch orgs, sandboxes, and Trailhead playgrounds (DE orgs). You can install a released package version in any org.
Create a New Project
To keep the unmanaged package and the project organized, it’s a good idea to create a workspace (or simply a directory folder) to store the metadata you are working with. Let’s create a new project to catch the metadata on your machine.
Build a Package.xml Manifest
The time has come for the first big step in our adventure. We’ve talked a lot about package.xml files, and now it’s time to build one yourself. As you write this file, keep in mind the names of the metadata components identified in this XML.
Pull Metadata Package from Playground
The next step is to pull the existing metadata out of the org and into the project by using the package.xml file created in the previous step and a Salesforce CLI command.
Create a Scratch Org
Next, create the scratch org that you’ll use to make changes to the metadata files and build more components for the sticker app.
Hands-on Challenge
You’ll be completing this challenge in your own hands-on org. Click Launch to get started, or click the name of your org to choose a different one.
What is Salesforce metadata?
Salesforce has a variety of tools you can use to work with the metadata in your org, such as change sets or the Salesforce command-line interface (CLI). When you’re deploying metadata, each of these tools serves a purpose and is very useful, depending on what you are aiming to accomplish.
What is XML in Salesforce?
XML (Extensible Markup Language) is a text-based language that is used to identify, organize, and migrate metadata components. When working with XML and Salesforce metadata, (remember, “metadata” is referring to the components inside your org), you identify specific components in the XML file.
What is package.xml manifest?
This language tells the system interesting things like which specific metadata components to retrieve, deploy, or update. When we think of coding languages, most of the time we tend to think of object-oriented programming languages such as Apex, Java, or JavaScript. These languages bring some sort of action to the components you’re working with, like having a button execute a class, or sending an email. The XML language operates a bit differently.
What is metadata component?
A metadata component is an instance of a metadata type. Metadata types are the general classification for metadata components. For example, CustomObject is a metadata type for standard and custom objects. In the example below, the MyCustomObject__c custom object (a metadata component) is an instance of the CustomObject metadata type.
