Monday, April 3, 2017

Retrieve Salesforce Profile XML using Workbench

For retrieving salesforce profile, you need to fetch all metadata components which consists of custom objects, applications, VF pages, Apex classes etc. So in profile retrieve request you not only get profile, but all other metadata components.

In Article Retrieve Metadata Using Workbench, I explained process to use workbench for retrieving a particular metadata type. Profile is also one of the metadata type, but it requires other components with it for it to work.

Here is the sample XML that you can use to retrieve profiles -

https://github.com/sushilgit/ProfileComparison/blob/master/Tool/package.xml

In above xml, if you want to retrieve some specific profiles instead of all, you may update the xml as follows -

 <types>
<members>Custom: Marketing Profile</members>
        <name>Profile</name>
 </types>

What are the type of profile permissions retrieved by above process -

Apex Class
Apex Page
Custom application
Custom Object
Custom Tab
HomePageLayout
Layout
Connected App
External Data Source
Custom Permission

Sunday, April 2, 2017

Salesforce Page Layout Comparison

Are you trying to solve one of the below problems -

1. Want to consolidate two profiles, but they have different page layout assigned. Looking for some automated way to compare big layouts ?

2. Trying to consolidate layouts on object like account and need a way to compare them ? 

I have built a tool to compare layouts which generates side by side comparison in excel with all fields on layout. 

Here is the link to the tool - Layout Comparison Tool

Using Workbench to Retrieve Metadata

This article covers list of steps you can follow to retrieve metadata from salesforce using workbench.

1. First create package.xml file. Here is the sample to retrieve all layouts in the org.

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

2. Now go to workbench (Workbench) and login to your sandbox, production or dev org. for Developer org choose Production as environment.



3. After you login, you will see following screen. Click on Migration dropdown and select Retrieve as option. 


4. You will see below screen. Choose package.xml file created in step1 in choose file option. And select single package checkbox. Click Next - 



5. You will see below confirmation screen, Click on Retrieve to start the retrieval process. 



6. Above process runs for some time based on the amount of metadata you have. Once completed, you will see below screen. You can download the file by clicking Download zip file.