You need to sign in to do that
Don't have an account?
Rajat Mahajan 48
How to retrieve all page layouts via Metadata Class???
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
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
https://stackoverflow.com/questions/9949078/can-i-access-all-page-layouts-specific-to-an-object-via-the-salesforce-api