Importing selected salesforce org components in IDE or Eclipse swiftly

IDE/Ecipse is a preferred tool that we all use for coding purpose, when the codes are of short length we prefer UI for coding but when we have very lengthy codes IDE/Eclipse is a best option. It also allows us to search in the entire ORG if any object or field is being referenced in any class, trigger or workflow etc(This is something which is very difficult to do manually from UI in the org).

Many times we require only certain components of the org in IDE/Eclipse, and its only fair to get those components rather then all the components of the org. At times entire org could be so huge that its almost impossible to get the entire org in time. IDE allows us to get the selected components from the org. A faster way to get only selected components is by modifying the package.xml. Here we have to just put the component members (that we wish) in the package.xml file and save it, components will get downloaded very swiftly in this way.

Follow this steps to get only selected components in IDE:

1. Create new project in IDE, fill in all the details (username,password, security token) and click finish.

2. From the "choose initial components" window choose 'none' and click finish, this will instantly create the project.
    

3. Right click on project and select workoffline
 

4. Now open the package.xml file, modify its content to include whichever components you wish to download in IDE


With none components selected your package.xml will look like following:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    
    <version>28.0</version>
</Package>

Now suppose you wish to include trigger,classes and page members then you need to include those members as below

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
    <members>*</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexPage</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexTrigger</name>
    </types>
 <version>28.0</version>
</Package>

4. Press cntrl+s to save the package.xml file

5. Right click on project and select work online, your new components will now be populated in your project. If it does not populate the components, try to refresh from server, or close the IDE and reopen and then refresh from server.

No comments:

Post a Comment