3

I can read layouts from any other objects but for some reason I cannot get the layouts from a namespaced object.

End point: /services/Soap/m/39.0

The List Reponse:

<result>
<createdById>xxxx</createdById>
    <createdByName>xdxxxxx</createdByName>
    <createdDate>2017-06-14T14:13:23.000Z</createdDate>
    <fileName>layouts/ChargentOrders__ChargentOrder__c-Test.layout</fileName>
    <fullName>ChargentOrders__ChargentOrder__c-Test</fullName>
    <id>xxxx</id>
    <lastModifiedById>xxxxx</lastModifiedById>
    <lastModifiedByName>xxxx</lastModifiedByName>
    <lastModifiedDate>2017-06-14T14:13:28.000Z</lastModifiedDate>
    <manageableState>unmanaged</manageableState>
    <type>Layout</type>
</result>

The request payload

<?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <env:Header>
            <urn:SessionHeader xmlns:urn="http://soap.sforce.com/2006/04/metadata">
                <urn:sessionId>xxxx</urn:sessionId>
            </urn:SessionHeader>
        </env:Header>
        <env:Body>
            <readMetadata xmlns="http://soap.sforce.com/2006/04/metadata">
                <type>Layout</type>
                    <fullNames>ChargentOrders__ChargentOrder__c-Test</fullNames>
            </readMetadata>
        </env:Body>
    </env:Envelope>

The response I get is

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <readMetadataResponse>
            <result>
                <records xsi:nil="true"/>
            </result>
        </readMetadataResponse>
    </soapenv:Body>
</soapenv:Envelope>

I can get layouts fine from other custom object. The Layout I am trying to get in the case is not managed but i on a managed object.

Notes: I can get CustomFields metadata and the other managed layouts from this managed object so access to the object is not the issue.

Any Idea why the request for a non managed layout on a managed object returns nill when it is clearly listed in the listed metadata response ?

Changing API versions does not help either. Attempted v30 - 40

Layout CAN be retrieved using the Andrew's Apex metadata implementation during Async. Not sure why it is not returned the way I am doing it

Your Answer

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

Browse other questions tagged or ask your own question.