Deploy a custom button in Salesforce

Posted on 17-05-2013 08:55 by graham
To deploy a custom button on an object in Salesforce using ANT or Eclipse, you need to include the definition of this button in the .object file that you are deploying:
SomeObject.object
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<enableEnhancedLookup>false</enableEnhancedLookup>
<webLinks>
<fullName>Custom_Button_Name</fullName>
<availability>online</availability>
<displayType>button</displayType>
<hasMenubar>false</hasMenubar>
<hasScrollbars>true</hasScrollbars>
<hasToolbar>false</hasToolbar>
<height>600</height>
<isResizable>true</isResizable>
<linkType>url</linkType>
<masterLabel>Button label</masterLabel>
<openType>newWindow</openType>
<position>none</position>
<protected>false</protected>
<showsLocation>false</showsLocation>
<showsStatus>false</showsStatus>
<url>http://wordgraphs.com</url>
</webLinks>
</CustomObject>

The you simply deploy the package, placing the reference to this custom object in your package.xml file:
package.xml
<types>
<members>SomeObject/members>
<name>CustomObject</name>
</type>
Comments

 

Add comment

Has this tutorial been helpful to you? Or do you see anything wrong? We appreciate your opinion!
Your comment:
Show formatting hints
HTML is disallowed, but in your text you can use the following markup
  • [code][/code] for a block of code
  • [tt][/tt] for inline code
  • [link]link href|link anchor[/link] for links
  • [b][/b] for bold text
Email:
+ Ask a question
If you have a technical question related to programming and computers, ask it here. Other users will help you solve it!
Unanswered questions
Share your knowledge by helping others solve their problems