[SalesForce] Spring 17 Lightning metadata: Assign Record Pages by App, Record Type, and Profile

Spring '17 includes the ability to assign lightning pages with far more granularity with the functionality delivered in Assign Record Pages by App, Record Type, and Profile.

Are these assignments and activations of lightning pages by App, Record Type & Profile exposed to us in metadata that can be retrieved from the org? (to be deployed later to another org)

Best Answer

This has been exposed via the metadata API documented here

ProfileActionOverride

Represents an override of an ActionOverride by a user profile. You can use it to override an ActionOverride on a standard Home tab or object record page in Lightning Experience. When a user logs in with a profile, a matching ProfileActionOverride assignment takes precedence over existing overrides for the Home tab or record page specified in ActionOverride. You can only access ProfileActionOverride by accessing its encompassing CustomApplication or Profile. Available in API version 39.0 and later.

Metadata XML Sample

<CustomApplication xmlns="http://soap.sforce.com/2006/04/metadata">
<profileActionOverrides>
    <actionName>View</actionName>
    <content>CustomObjectFlexiPage</content>
    <formFactor>Large</formFactor>
    <pageOrSobjectType>TestObj__c</pageOrSobjectType>
    <type>Flexipage</type>
    <profile>standard</profile>
    <recordType>TestObj__c.TestRecordType</recordType>
</profileActionOverrides>
<defaultLandingTab>standard-home</defaultLandingTab>
 <formFactors>Large</formFactors>
  <label>My Custom App</label>
  <tab>standard-Account</tab>
  <tab>standard-Opportunity</tab>
  <uiType>Lightning</uiType>
  <navType>Standard</navType>
 </CustomApplication>

Package.xml

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