function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ranalsheikhranalsheikh 

Installing Custom Buttons in Page Layouts

We are currently developing an Apex application to be packaged and listed in the AppExchange directory.

Our application contains custom buttons associated with the Account, Case, Contact, Lead, Opportunity objects.

Before we created the package, we added the custom buttons to their respective page layouts (Account, Case, Contact, Lead, Opportunity) in our development organization where the application was developed.

 

After we installed our managed package in one of our sandboxes, we found out that the custom buttons were not displaying in the respective sandbox page layouts.

 

We tried adding the custom buttons manually, after the installation, by customizing the layout of the respective pages and drag-and-dropping the custom buttons.

However, we found out that this action did not have an organization-wide effect. By logging with a different user, we would not see the custom buttons in the respective page layouts that had been added by another user.

 

So our questions are:

 

1) Can the installation of a managed package also add custom buttons to the page layouts of the target organization?

 

2) If not, how should proceed the user performing the installation in order to manually add the custom buttons to the respective layouts, in a way that the action has an organization-wide effect (all users of the organization would see the custom buttons)?

 

We do not want to settle with a solution where, after package installation, each and every user of the organization would have to add manually the custom buttons.

Best Answer chosen by Admin (Salesforce Developers) 
ranalsheikhranalsheikh

I have just verified that adding the custom button to *all* layouts for a given object ensures that all users in the organization will see the new buttons on the account's page.

 

I had initially missed some layouts, so that is why some users were not seeing the buttons.

 

My concern was that the page layouts were associated with each user (and not to the entire organization), so the system kept for each user his own custom version of the layout.  

 

As a result, each individual user would have to add the buttons by themselves to their own custom layouts in order to see the buttons. That would be definitively a setup nightmare scenario. 

 

 

All Answers

A_SmithA_Smith

These cannot be auto added during install.  

 

Not sure what you mean by each user needs to add them.  There should only be a few pages layouts in your org for that object.  You need to add the button to each page layout, which shouldn't be that many.  Maybe that's why some users didn't see the button?

 

Also, if your package is set up to use the LMA and your using per user licensing, each user will need a license to the package to see the button.   

ranalsheikhranalsheikh

I have just verified that adding the custom button to *all* layouts for a given object ensures that all users in the organization will see the new buttons on the account's page.

 

I had initially missed some layouts, so that is why some users were not seeing the buttons.

 

My concern was that the page layouts were associated with each user (and not to the entire organization), so the system kept for each user his own custom version of the layout.  

 

As a result, each individual user would have to add the buttons by themselves to their own custom layouts in order to see the buttons. That would be definitively a setup nightmare scenario. 

 

 

This was selected as the best answer
ssorokassoroka

I'm having the exact same problem.  I don't understand how you resolved it.

Huy NguyenHuy Nguyen
Hi ranalsheikh,

Could you please show me how to do that ?