Search code examples
salesforcesoql

Salesforce:- How to assign Page Layout of an Object (Standard or Custom ) to Profile via SOQL


How to assign Page Layout of an Object (Standard or Custom ) to Profile via SOQL

Is that possible?

Note:- I know how to do that via SFDC UI. I would like to automate this assignment.


Solution

  • Page Layouts are not available via SOQL or Apex. It has been proposed as an idea and needs more upvotes: https://success.salesforce.com/ideaView?id=08730000000KmowAAC

    What you CAN do is use the metadata API. You'd have to muck around with building the right XML that defines the layout assignment. Check out https://salesforce.stackexchange.com/questions/852/page-layout-assignments-with-xml-metadata-api