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
johndoejohndoe 

How can you add buttons from custom object to a page layout?

A button is created in the custom object, is there any way to add the button to the page layout of any layout such as Account/Opportunity?
I had to add the button to the custom object because the force ide was not including the custom buttons and links created in the account customizations, and so wasnt able to deploy them. Is there any workaround for this?

Best Answer chosen by Admin (Salesforce Developers) 
johndoejohndoe

Thanks i got it working using layouts. My apprehension was that if i deploy a layout the user would be forced to use that layout, but after using it i realised that is not the case. I can see th ebuttons and links separately.

All Answers

Avidev9Avidev9
Buttons are object specific and can be added to the same object where they belong.
You cannot move the same button accross objects
Sunny670Sunny670
No you cannot. Create the same button in Account/Opportunity and then you can add them in their layouts.
johndoejohndoe
But how do you get that button in the package.xml for the force.com ide to deploy it
Sunny670Sunny670
You can deploy the layout.
johndoejohndoe

Thanks i got it working using layouts. My apprehension was that if i deploy a layout the user would be forced to use that layout, but after using it i realised that is not the case. I can see th ebuttons and links separately.

This was selected as the best answer
Sunny670Sunny670
Please mark it as a solution.It can help others.