11

I'm developing a managed package and I have some custom fields of "Lead" sobject included + custom lead layout. I want to automate it all for user. Is there any way to: replace default layout, add fields to existing layout, add custom layout and assign it to all? I found the same question, but it's still not answered. Update layout in post install script And this description:

Page Layouts

The page layout of the person uploading a package is the layout used for Group and Professional Edition organizations and becomes the default page layout for Enterprise, Unlimited, and Developer Edition organizations.

Page layouts should be packaged alongside complimentary record types if the layout is being installed on an existing object. Otherwise, the installed page layouts must be manually applied to profiles.

If a page layout and a record type are created as a result of installing a package, then the uploading user’s page layout assignment for that record type is assigned to that record type for all profiles in the subscriber organization unless a profile is mapped during an install or upgrade.

does not seem to be working. I'm getting just duplicate of layout.

It is possible or user needs to assign layout manually after installing?

Thanks.

2
  • We are actually facing the same issue Jun 23, 2015 at 18:56
  • Have you ever figured it out?
    – zaitsman
    Feb 25, 2019 at 0:44

1 Answer 1

3

Page layouts in a managed package can only be created, not updated. The rationale, is that your subscribers have their own custom fields and may want make adjustments that won't get overwritten by managed package updates.

Your only option, and it's a tricky one, would be to use the Metadata API. You would have to figure out programmatically, where to slot in your new fields alongside your subscribers' custom fields, what to do if your fields or sections were removed from the layout entirely. I couldn't imagine coding this, to be honest with you.

I think your best bet is good documentation and notifications to your subscriber admins post install.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .