Contents[Hide]

In case that you have a lot of metadata in your organization (classes, pages, triggers, objects etc.) it is hard to select only few of them in Force IDE as it freeze for longer time on metadata list selection when you search for names. Therefore if you know already name of needed components it is possible to compose package.xml manually. 

This can be also useful if you are preparing package for deployment.

1. Package.xml file structure.

Sample structure:

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

Structure is very easy:
<types> - groups metadate of one type together
<name> - metadata type name
 <members> - list metadata names

I ti si possible to put star symbol in <members> tag, then all metadata of this type will be downloaded.

2. Possible type names and members name format.

Based on force API version 33.

Type Name Tag Member Name format
Class <name>ApexClass</name> <members>My_Page_Controller</members>
Component <name>ApexComponent</name> <members>Component_Name</members>
Page <name>ApexPage</name> <members>My_Page</members>
Trigger <name>ApexTrigger</name> <members>EMS_Budget_Product_Trigger</members>
 

Approval Process

<name>ApprovalProcess</name> <members>Object_Name__c.Approval_Process_Name</members>
Application <name>CustomApplication</name>  
Custom Field <name>CustomField</name> <members>Object_Name__c.FieldName__c</members>
Label <name>CustomLabel</name> <members>Label_Name</members>
Object <name>CustomObject</name> <members>Object_Name__c</members>
Tab <name>CustomTab</name> <members>Tab_Name</members>
Email Template <name>EmailTemplate</name> <members>Email_Templ_Folder_Name\Email_Template_Name</members>
Flow <name>Flow</name> <members>Flow_Name-1</members> // 1 is a version number
Page Layout <name>Layout</name> <members>Object_Name__c-Page_Layout_Name</members>
ListView <name>ListView</name> <members>Object_Name__c.ViewName</members>
Permission Set <name>PermissionSet</name> <members>Perm_Set_Name</members>
Profile <name>Profile</name> <members>Profile_Name</members>
Public Group <name>Group</name> <members>Group_Name</members>
Static Resource <name>StaticResource</name> <members>Static_Res_Name</members>
Custom Button, Link <name>WebLink</name> <members>Object_Name__c.Button_Name</members>
Workflow <name>Workflow</name> <members>Workflow_Name</members>
Security Settings <name>Settings</name> <members>Security</members>
Assignment Rules, Auto-response Rules, Escalation Rules <name>AssignmentRule</name>
<name>AssignmentRules</name>
<members>Object_Name.Rule_name</members>
<members>Object_Name</members>
Record Type <name>RecordType</name> <members>Object_Name.Record_Type_Name</members>
Home Page Component <name>HomePageComponent</name> <members>Home Page Component Name</members>

Custom sttings should be added as custom object.

Additional resources:
Metadata types
How to create package.xml

   
© Paweł Woźniak