Newer Version Available

This content describes an older version of this product. View Latest

Retrieve and Pull Changes to Profiles with Source Tracking

Retrieving and pulling profiles behaves a little differently with source tracking.

Without source tracking, retrieving profiles only returns some profile information. Retrieving profiles returns information about profiles that pertains to other items specified in the package.xml file.

For example, retrieving profiles with this package.xml file returns profile permissions for the MyCustomField__c custom field on the Account object.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4  <members>Account.MyCustomField__c</members>
5  <name>CustomField</name>
6 </types>
7 <types>
8  <members>*</members>
9  <name>Profile</name>
10 </types>
11 <version>50.0</version>
12</Package>

With source tracking, retrieving profiles returns profile information pertaining to anything else specified in the package.xml file plus any components getting tracked by source tracking. That includes any entity for which a change exists between your local project and the org.

For example, say you create a custom field on the Opportunity object called OppCustomField__c in your local environment. Source tracking detects the change and reports it. Now you retrieve profiles using the same package.xml file as you did when source tracking was off.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4  <members>Account.MyCustomField__c</members>
5  <name>CustomField</name>
6 </types>
7 <types>
8  <members>*</members>
9  <name>Profile</name>
10 </types>
11 <version>50.0</version>
12</Package>

Even though the package.xml file doesn’t reference OppCustomField__c, because source tracking is tracking the new custom field, your retrieve returns profile permissions for both the MyCustomField__c custom field on the Account object and the OppCustomField__c on the Opportunity object.

For more information about retrieving profiles, see the Profile metadata type in the Metadata API Developer Guide.

Although source pulls don’t include package.xml files, both pull requests and retrieve requests return profile information pertaining to everything reported by source tracking.

Note