I know the way to create custom pageLayout via setup . Can we automate this process of creating page layouts when I am installing the managed package ?

If there is a way , please point me in that direction. Appreciate the help.


You can include Page Layouts in the managed package, and then they will be deployed alongside the rest of your work as normal during install.

It is generally not advised to include overriding page layouts for Standard objects though as nearly all organisations will already have their own page layouts customised in their org and will not want one from a managed package that won't cater for any of their own customisations.

You also can't update Page Layouts via managed packages, only provide new ones and deprecate old ones.

Having typed that all up - it occurs to me that you might be aware of that and are therefore asking what the best way to "replicate" the page layout changes you need in an org having installed a package because you don't want to include the layout in the package. Unfortunately there is no real way to make an incremental change to a page layout that I am aware of.. you could try to push it into an Org via the Metadata API - but that will have the same impact as having included it in the package ie. it can only provide an entire, discrete page layout, there is no way to inject changes "simply" into existing layouts in a target org.

I hope some of that info is useful, and sorry I perhaps can't be more helpful!

  • does this mean that ,I cannot add new section to Accounts or Leads or Opportunity tabs using script – Abi Jan 16 '17 at 5:24
  • You can do anything using a "script" ... if you log into the orgs Metadata API and copy a chunk of XML into the right place, for example. But if you mean Apex, or other platform based execution scripts, don't think so. – Simon Lawrence Jan 16 '17 at 9:21
  • okay , so while Installing managed packages can we invoke custom scripts which does the work (modify the page layouts of apex pages like Accounts) – Abi Jan 17 '17 at 3:43

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.