4

I'm developing an app for the appexchange containing custom visualforce pages/components.

Instead of asking the user to create custom fields and edit layouts to place the vf pages after the installation, I would like to automate the process.

I know there is the post-install script to do it, but my question is "How to do it"?

After all the reading, it seems I need to use the metadata api which use soap and a login/password. How can I ask the user who install my app to set this login/password in order to use it to make the good soap call?

Is there posible the customize the steps of the installation?

What I want is to update existing layouts, like the Contact one, in order to add a section without overriding the whole layout. i don't want the user to lose the way they edited their layouts.

3

With reference to installations, from the Salesforce Packaging Guide:

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.

As you can see, nothing is mentioned about post install scripts. It all needs to be done as part of the metadata package during the installation. More of the process is explained in the above document.

In an upgrade package however, there is a post install script that allows you to replace page layouts. As I understand it though, the script option isn't available in an original install package. More details are in the document on what options are available to you.

  • Hi, I missed this document, I will take a look thanks! Quickly, imagine I put in my package a new layout for an existing object (Contact for example), will it override the existing page layout or merge them? I would like to merge them in order the user keep the layout the way they defined it and just add the section I added. I don't know if I'm clear :) This is why I thought of the metadata api. Because I would have retrieved the xml of the layout, inserted a new section and deployed the xml – Philippe May 23 '13 at 15:32
  • In an upgrade package, there is a post install script that allows you to replace page layouts. However, as I understand it, the script option isn't available in an original install package. More details are in the document on what options are available to you. – crmprogdev May 23 '13 at 15:56
0

My experience with packaged page layouts is that they get deployed upon initial installation of your package, but there is no way to automate the addition of new fields to previously packaged/deployed page layouts when you install an upgraded version of your managed package.

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.