You need to sign in to do that
Don't have an account?
herodotus
HOWTO Upload Custom Button to a Custom Object Using ANT - Anyone figured this out?
Has anyone managed to deploy a custom javascript button using ANT.
After looking around a bit I can't find any help on this.
An example with package.xml, and the object xml would be much appreciated, as would any pointers on where to look to figure this out.
For example, in package.xml, what name do we use in Package/types/name markup. CustomObject?
If CustomObject is correct, what markup should be in the customobject.object file in the objects directory?
Thanks
After a bit of poking around it turns out that the buttons are called WebLinks.
In package.xml put a section like:
<Package>
<types>
<members>objectname.buttonnamegoeshere</members>
<name>WebLink</name>
</type>
</Package>
then put the object in the objects directory.
In the objectname.object file, put the button setup into a section like
<CustomObject>
<webLinks>
<fullName>buttonnamegoeshere</fullName>
<availability>online</availability>
<displayType>massActionButton</displayType>
<linkType>javascript</linkType>
<masterLabel>Button Lable Goes Here</masterLabel>
<openType>onClickJavaScript</openType>
<protected>false</protected>
<url>window.location.href='/apex/CreditAppExtension?returl=%2F{!Opportunity.Id}&launchId={!Opportunity.AccountId }&launchMode=newFromOpportunity&oppId={!Opportunity.Id}';</url>
</webLinks>
</CustomObject>
The java script goes in the url section.
All Answers
After a bit of poking around it turns out that the buttons are called WebLinks.
In package.xml put a section like:
<Package>
<types>
<members>objectname.buttonnamegoeshere</members>
<name>WebLink</name>
</type>
</Package>
then put the object in the objects directory.
In the objectname.object file, put the button setup into a section like
<CustomObject>
<webLinks>
<fullName>buttonnamegoeshere</fullName>
<availability>online</availability>
<displayType>massActionButton</displayType>
<linkType>javascript</linkType>
<masterLabel>Button Lable Goes Here</masterLabel>
<openType>onClickJavaScript</openType>
<protected>false</protected>
<url>window.location.href='/apex/CreditAppExtension?returl=%2F{!Opportunity.Id}&launchId={!Opportunity.AccountId }&launchMode=newFromOpportunity&oppId={!Opportunity.Id}';</url>
</webLinks>
</CustomObject>
The java script goes in the url section.
Thanks for the solution. It saved my time.