Why?, We don't create a managed package in sandbox.
In Salesforce, you cannot create a managed package in a sandbox environment because managed packages are meant to be installed and distributed to other Salesforce orgs. Sandboxes, on the other hand, are intended for development and testing purposes and are not intended to be used as production orgs.
When creating a managed package, it is important to ensure that the package is tested and stable before distributing it to other orgs. Sandboxes are typically used for development and testing, and it is not advisable to distribute packages from a sandbox environment because the contents of the sandbox can be unstable and may not be ready for production.
In addition, creating a managed package in a sandbox environment can lead to version control issues. Each package version must be associated with a unique namespace, which is generated when the package is created. If a package is created in a sandbox environment, it may be difficult to ensure that the namespace is unique and not already in use by another package in a different org.
Therefore, to create a managed package in Salesforce, you should use a production or developer edition org, which can be used to build, test, and distribute the package to other Salesforce orgs. Once the package is ready, it can be uploaded to the Salesforce AppExchange or installed directly in other orgs using the installation URL or installation key.
For those who don't have any clue what NAMESPACE is?
领英推荐
In Salesforce, a namespace is a unique identifier that is associated with an organization's metadata and custom code. A namespace is used to ensure that your organization's customizations and managed packages don't conflict with other organizations' customizations and managed packages.
When you create a managed package in Salesforce, you are required to specify a namespace prefix. This prefix is a unique identifier that is appended to all of the custom objects, custom fields, Apex classes, Visualforce pages, and other metadata components that are included in the package. The namespace prefix ensures that the names of these components don't conflict with the names of components in other packages or in the subscriber's org.
The namespace prefix must be between 1 and 15 characters long, and can only include letters and digits. Once you have created a namespace prefix, it cannot be changed or deleted. This means that you should choose your namespace prefix carefully, to ensure that it is meaningful and easy to remember.
When a managed package is installed in a subscriber's org, the namespace prefix is automatically added to the names of all the components included in the package. This ensures that there are no conflicts with other customizations in the subscriber's org. For example, if you create a custom object called "MyObject" in your managed package with the namespace prefix "myNS", the object will be named "myNS__MyObject" when it is installed in a subscriber's org.
In summary, a namespace is a unique identifier that is associated with an organization's metadata and custom code in Salesforce. When creating a managed package, a namespace prefix is required to ensure that the names of components in the package do not conflict with the names of components in other packages or in the subscriber's org.