2

When I go to the list of User Page Layouts, I see that there are three different User layouts available in my organization

Page Layout Name
User Layout
User Profile Layout
Community Member Layout

enter image description here

However, when I try to use package.xml with the following body,

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

I receive an error saying

Retrieve warnings (2):
package.xml - Entity of type 'Layout' named 'User-Community Member Layout' cannot be found
package.xml - Entity of type 'Layout' named 'User-User Profile Layout' cannot be found

enter image description here

Usually a layout has the object developer name with hyphen symbol appended as a prefix to layout name when it is needed to retrieve it by Ant, at least the first layout is retrieved successfully, however, two other layouts are not.

Even if I change prefix to User Profile or to Community Member, it doesn't work, even when I try to use package.xml with the following body,

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

and it returns the same error

Retrieve warnings (2):
package.xml - Entity of type 'Layout' named 'Community Member-Community Member Layout' cannot be found
package.xml - Entity of type 'Layout' named 'User Profile-User Profile Layout' cannot be found

enter image description here

3

It is possible to use sf:listMetadata target

<project name="Sandbox" basedir="." xmlns:sf="antlib:com.salesforce">
    <target name="List Metadata Profiles">
        <sf:listMetadata username="${sf.sandbox.username}"
                         password="${sf.sandbox.password}${sf.sandbox.securityToken}"
                         serverurl="${sf.sandbox.serverurl}"
                         metadataType="Profile"
                         resultFilePath="profiles.txt" />
    </target>
</project>

to find out the names for the exotic page layouts. If this target is used, the profiles.txt can be examined to search the required names.

Actually it contains the required names.

CommunityMemberLayout-Community Member Layout
UserAlt-User Profile Layout

These names can now be used to retrieve the layouts metadata

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>User-User Layout</members>
        <members>UserAlt-User Profile Layout</members>
        <members>CommunityMemberLayout-Community Member Layout</members>
        <name>Layout</name>
    </types>
    <version>45</version>
</Package>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.