How to move record type permissions in profile using Apache ANT tool in Salesforce?

How to move record type permissions in profile using Apache ANT tool in Salesforce?

1. Execute the below Query in https://workbench.developerforce.com.

Query:


SELECT sObjectType, DeveloperName FROM RecordType

2. Copy the result in an excel file.

3. Use Concatenate excel function to create like below

<members>sObjectType.DeveloperName</members>

4. Copy all the concatenated SobjectName.Name in the package.xml like below

<?xml version=”1.0″ encoding=”UTF-8″?>
<Package xmlns=”http://soap.sforce.com/2006/04/metadata”>
<types>
<members>Account.Sample1</members>
<members>Account.Sample2</members>
<name>RecordType</name>
</types>
<types>
<members>*</members>
<name>Profile</name>
</types>
<types>
<members>*</members>
<name>Layout</name>
</types>
<version>30.0</version>
</Package>

5. Retrieve using the package.xml.

6. Delete the objects and layouts folders.

7. Remove objects and layouts in package.xml.

<?xml version=”1.0″ encoding=”UTF-8″?>
<Package xmlns=”http://soap.sforce.com/2006/04/metadata”>
<types>
<members>*</members>
<name>Profile</name>
</types>
<version>30.0</version>
</Package>

8. Now deploy.

Cheers!!!

Leave a Reply