2

How can i deploy assignement of Compact layout & Record Lightning page to Record Type/Profil . I tried this package ,the compact layout and record page were deployed properly but the assignement to profil and record type were not deployed ,what i need to add in my package to deploy assignements also ?

    <types>
        <members>Account.CFCompactLayout</members>
        <name>CompactLayout</name>
    </types>
    
    <types>
        <members>Comptes_de_Facturation</members>
        <name>FlexiPage</name>
    </types>

Thanks a lot

enter image description here

enter image description here

2 Answers 2

1

Summary

You need to include the metadata that is actually changed by your action: in your case, this is the custom object for the compact layout assignments and all of the custom application(s) included in the Lighting Page Assignments. Based on what I see in the screenshots, the below should reflect what you changed:

<types>
    <members>Account.CFCompactLayout</members>
    <name>CompactLayout</name>
</types>
    
<types>
    <members>Comptes_de_Facturation</members>
    <name>FlexiPage</name>
</types>

<types>
    <members>Account</members>
    <name>CustomObject</name>
</types>

<types>
    <members>Console_de_Vente</members>
    <name>CustomApplication</name>
</types>


Details

You're asking two things

Compact Layout Assignments

This is stored in the custom object metadata under compactLayoutAssignment within the RecordType property so you need to include whatever object you're changing the record type/compact layout assignment. It'll look like something like this within the metadata you pull

recordTypes xmlns="http://soap.sforce.com/2006/04/metadata">
  <fullName>YourRecordTypeName</fullName>
  <active>true</active>
  <compactLayoutAssignment>YourCompactLayout</compactLayoutAssignment>
....

Lightning Page Assignment

This is stored in two different locations depending on what you do.

Org Default - Setting a page as the org default changes the custom object metadata under actionOverrides. You'll see something like this within your object metadata:

<actionOverrides>
    <actionName>View</actionName>
    <comment>Action override updated by Lightning App Builder during activation.</comment>
    <content>Your_Lightning_Page</content>
    <formFactor>Large</formFactor>
    <skipRecordTypeSelect>false</skipRecordTypeSelect>
    <type>Flexipage</type>
  </actionOverrides>

Assignment by app, profile, and record type or App Default - This is stored in the custom application metadata. It'll be under the profileActionOverrides field and look something like this:

 <profileActionOverrides>
    <actionName>View</actionName>
    <content>Your_Lightning_Page</content>
    <formFactor>Large</formFactor>
    <pageOrSobjectType>Account</pageOrSobjectType>
    <recordType>Account.YourRecordType</recordType>
    <type>Flexipage</type>
    <profile>Admin</profile>
  </profileActionOverrides>
1
  • Thank you very much for your help ,very good explanation Aug 10, 2021 at 12:54
1

You need to include the profiles when retrieving/deploying:

<types>
    <members>Account.CFCompactLayout</members>
    <name>CompactLayout</name>
</types>

<types>
    <members>Comptes_de_Facturation</members>
    <name>FlexiPage</name>
</types>
<types>
    <members>*</members>
    <name>Profile</name>
</types>
3
  • Thank you .So i need only profiles in my package but how about assignement to record type ? Aug 10, 2021 at 10:55
  • @user3499987 the mdapi will retrieve the related mappings if you retrieve the profile and the things you want permissions/assignments for. That's how it works.
    – sfdcfox
    Aug 10, 2021 at 13:11
  • It may work, but let's be be aware about doing this, because deploying * regarding profiles you will replace everything, in terms of profile, in the target ORG Apr 20, 2022 at 0:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .