3

I'm trying to get the CompactLayout through package.xml but I don't its retrieving

here is my package.xml looks like:

<type>
    <members>my_custom_object__c-my compact layout</members> 
    <name>CompactLayout</name>
</types>

3 Answers 3

2

From documentation:

Compact layouts are defined as part of the custom object, standard object, or external object definition.

You need to have it defined in the Object's metadata xml definition as below:

<compactLayouts>
    <fullName>testCompactLayout</fullName>
    <compactLayoutItems>textfield__c</compactLayoutItems>
    <label>testCompactLayoutLabel</label>
</compactLayouts>
1

Compact layout can be retrieved using objectname . compact layout name api as shown below. here oppcompact is compact layout name.

<types>
    <members>Opportunity.oppcompact</members>
    <name>CompactLayout</name>
  </types>

you can use https://packagebuilder.herokuapp.com/ to build your package.xml

2
  • Did not work, I tried exactly as you have objectname.compactlayoutapiname
    – Nick
    Commented Nov 7, 2018 at 1:27
  • this is working version. May be you are missing somehting else. Can you edit your question with screenshot of your compact layout api name and your complete xml. note: package.xml is case sensitive
    – Himanshu
    Commented Nov 7, 2018 at 2:01
0
**<type>**
    <members>my_custom_object__c-my compact layout</members> 
    <name>CompactLayout</name>
</types>

In first line you have mentioned as <type> please use <types> instead.

1
  • Please use the formatting tools in the editor to ensure your post looks correct. No one was able to read your post because bracketed items don't render unless marked as code.
    – David Reed
    Commented Aug 14, 2020 at 15:19

You must log in to answer this question.

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