function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ShivaShiva 

Adding package in eclipse

I have created new package in SFDC but I want to add the same package to eclipse project. How?

 

Thanks

 

Best Answer chosen by Admin (Salesforce Developers) 
JonPJonP

In the IDE, a Force.com Project can be created against a package.  Just go to File > New Force.com Project, and on page 2 of the wizard select the option to connect to a specific package and choose which package from the picklist control.  With a project created against a package like this, any new components you create in the project from the IDE will be added to the package, and any components you add to the package via the web UI will appear in your IDE project the next time you Refresh from Server.

 

 

Note that in the Force.com platform, components that have been added to a locally created package are not "in" that package in a strong way. For instance, you can add the same component to multiple packages.  And in the IDE, you can download a component outside of any particular package, regardless what package it's in.

 

The behaviors change for installed packages.  Components installed into your org as part of a managed package are not available in the Force.com IDE at all.  Components installed as part of an unmanaged package are fully editable and can be downloaded into the IDE, and can even be added to your locally created packages, but they cannot be removed from the package which installed them.  And if you uninstall that package, those components will be removed from your organization, even if you've changed them.

 

Hopefully this answers your question.  If not, please say more about what specifically you are trying to do.

All Answers

JonPJonP

In the IDE, a Force.com Project can be created against a package.  Just go to File > New Force.com Project, and on page 2 of the wizard select the option to connect to a specific package and choose which package from the picklist control.  With a project created against a package like this, any new components you create in the project from the IDE will be added to the package, and any components you add to the package via the web UI will appear in your IDE project the next time you Refresh from Server.

 

 

Note that in the Force.com platform, components that have been added to a locally created package are not "in" that package in a strong way. For instance, you can add the same component to multiple packages.  And in the IDE, you can download a component outside of any particular package, regardless what package it's in.

 

The behaviors change for installed packages.  Components installed into your org as part of a managed package are not available in the Force.com IDE at all.  Components installed as part of an unmanaged package are fully editable and can be downloaded into the IDE, and can even be added to your locally created packages, but they cannot be removed from the package which installed them.  And if you uninstall that package, those components will be removed from your organization, even if you've changed them.

 

Hopefully this answers your question.  If not, please say more about what specifically you are trying to do.

This was selected as the best answer
ShivaShiva

Jon,

 

What if I have already  created the project without the package and would like to add the package after wards?

 

Thanks

 

JonPJonP
Create the package on the server, add whatever components to it, and then create a new Force.com project in the IDE against that package.
ShivaShiva

Sorry Jon,

 

May be I was not clear first time. In other words how can I add a package to the existing eclipse project? I know when I create a new project in eclipse it always ask me to select the package.

 

 

Thanks

 

JonPJonP

I think packages, and the IDE, work a little differently in Force.com than you might be thinking.  Tell me more about what you're trying to do, at a high level.

 

Also, specifically, what do you mean by "add a package to the existing eclipse project"?  In what way(s) would you expect your project change?

 

Thanks,

Jon