Step by step guide on how to create Salesforce package.
Let's start with - what exactly is Salesforce package?
Salesforce package is like snapshot of your Salesforce environment, essentially you can take certain components and make them available for other Salesforce organisations.
How to create Salesforce package?
1. First things first you need to go to the Setup and in the quick find menu type in "Package".
2. Select "Packages"
3. Select "New" in the Packages section
4. Fill in the empty fields with for you relevant information.
Managed checkbox at this point is not available to select. It will become available after you will add Salesforce fields, objects, tabs etc. to your package. Please note, only one package can be Managed package.
Configure Custom Link is custom link to a URL or s-control that you have created for your home page layouts.
Notify on Apex Error is optional field where you can enter the username of the person who should receive an email notification if an exception occurs in Apex that is not caught by the Apex code.
5. After you have created the package, you need to build an actual package i.g. add those Salesforce components that you want to include in your package, for example, fields, objects, tabs, workflow rules etc.
1) Start by adding your newly create app or object. The reason for that, is that all related components (like fields, relationships, page layouts...) usually are than added automatically. Therefore you can potentially save some time by starting with something more general, so all components that fall under are added automatically.
2) Double check "View Dependencies". This is helpful tool to see all dependent components, rather that adding all from the generics sections one by one.
6. After you have added all the components (I hope by now you had checked everything at least twice) just press the "Upload" and depending on have big your package is, sooner or later(usually it takes 1 to 4 minutes) you will receive notification email with the link to your package. This link can be also used to instal this package in other Salesforce organisations for testing purposes. This is a great way to test your app and be double check, that all necessary components had been included.