Deployment · Salesforce

How to retrieve & deploy new profile from one org to another org?

When you create custom profile in your development org – you may assigned lot of permission. When you try to deploy through Force.com Migration tool you need to make sure below permission are retrieved from source org.

  1. Standard Object – This will include Object & Field Level, Record Type Visibility, Tab Visibility permissions.
  2. Custom Object – This will include Object & Field Level, Record Type Visibility, Tab Visibility permissions.
  3. Apex Controller (Apex Class) – This include Class Access
  4. VF Page (Apex page) – This include Page Access
  5. System Permission (User Permission)

Once you retrieved – please delete following folders before you start your deployment

  1. classes
  2. objects
  3. Pages

screen-shot-2016-12-06-at-3-24-23-pm

And also remove “ApexClass, ApexPage, CustomObject” from deployment package.xml. Deploy only profile. That profile contains all the permission.

Use below package.xml for retrieveal:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>ProfileName</members>
        <name>Profile</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexPage</name>
    </types>
    <types>
        <members>*</members>
        <members>Account</members>
        <members>AccountContactRole</members>
        <members>Activity</members>
        <members>Asset</members>
        <members>AssistantProgress</members>
        <members>Campaign</members>
        <members>CampaignMember</members>
        <members>Case</members>
        <members>CaseContactRole</members>
        <members>Contact</members>
        <members>ContentVersion</members>
        <members>Contract</members>
        <members>ContractContactRole</members>
        <members>DandBCompany</members>
        <members>DuplicateRecordItem</members>
        <members>DuplicateRecordSet</members>
        <members>EmailMessage</members>
        <members>Event</members>
        <members>ExchangeUserMapping</members>
        <members>FeedItem</members>
        <members>ForecastingAdjustment</members>
        <members>ForecastingCategoryMapping</members>
        <members>ForecastingOwnerAdjustment</members>
        <members>ForecastingQuota</members>
        <members>ForecastingTypeToCategory</members>
        <members>Idea</members>
        <members>Lead</members>
        <members>Opportunity</members>
        <members>OpportunityCompetitor</members>
        <members>OpportunityContactRole</members>
        <members>OpportunityLineItem</members>
        <members>PartnerRole</members>
        <members>Pricebook2</members>
        <members>PricebookEntry</members>
        <members>Product2</members>
        <members>Question</members>
        <members>Reply</members>
        <members>Site</members>
        <members>SocialPersona</members>
        <members>SocialPost</members>
        <members>Solution</members>
        <members>StreamingChannel</members>
        <members>Task</members>
        <members>User</members>
        <members>UserProvisioningRequest</members>
        <name>CustomObject</name>
    </types>
  <version>36.0</version>
</Package>

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s