Extract Custom Button using Salesforce Package.xml
Meta data name for custom button is WebLink and below is the format to use it in your package.xml to extract using workbench or any other deployment tools like Eclipse, ANT, Gearset, Pipeline, ClickDeploy, AutoRABIT, Flosum etc
Salesforce Package.xml file structure:
<?xml version=”1.0″ encoding=”utf-8″ standalone=”yes”?>
<Package xmlns=”http://soap.sforce.com/2006/04/metadata”>
<types>
<members>Case-Case Feed Layout</members>
<name>Layout</name>
</types>
<types>
<members>Case.SendEmail</members>
<name>WebLink</name>
</types>
<version>41.0</version>
</Package>
Once retrieved the button details exists in the Case object with webLinks tag like below:
<CustomObject xmlns=”http://soap.sforce.com/2006/04/metadata”>
<webLinks>
<fullName>SendEmail</fullName>
<availability>online</availability>
<displayType>massActionButton</displayType>
<encodingKey>UTF-8</encodingKey>
<linkType>url</linkType>
<masterLabel>SendEmail</masterLabel>
<openType>replace</openType>
<protected>false</protected>
<requireRowSelection>false</requireRowSelection>
<url>https://theblogreaders.com</url>
</webLinks>
</CustomObject>
Deploying a custom button is a straightforward and can be done using change set as well using the below steps:
- Enable Organization connections between source and target Organization. You can access it under Setup:- “Deploy -> Deployment Settings”
- Setup a change-set in the source org
- Push change-set to target org
make sure to include following items in the change-set:
- Custom Button
- Account/Contact page layouts
and simply deploy to target organization
About Salesforce Change Sets:
Salesforce Deployment Connections: