• Rajat Mahajan 48
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hi All

Can anyone please help me understand how to retrieve all page layouts for an object using metadata api

In trail head i was able to find a snippet where you can retrieve one layout, but not all together. Was not able to figure out how to retrieve all-
//Method created to retrieve / query the page layouts of an object
    public static void queryPageLayouts() {
        
        // Retrieve Account layout and section 
        List<Metadata.Metadata> layouts = 
            Metadata.Operations.retrieve(Metadata.MetadataType.Layout, 
            new List<String> {'Account-Account (Marketing) Layout'});
        
        for(Metadata.Metadata layout : layouts) {
            System.debug('The layouts in Accounts are:'+ layout.fullname);        
        }
    }

The above helps me get one layout, if i were to retrieve all layouts, how should i write my code

Thanks,
Rajat
Hi 

Just went through the Metadata API trailhead today.
Which states that the Metadata API only supports Custommetadata API in the current release.

Wanted to know if anyone knows when would be able to create and modify other metadata components

Thanks
Hi 

Just went through the Metadata API trailhead today.
Which states that the Metadata API only supports Custommetadata API in the current release.

Wanted to know if anyone knows when would be able to create and modify other metadata components

Thanks