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
Brian NørremarkBrian Nørremark 

Create a custom button with Metadata API?

Hi all,
I created a custom button in Classic by hand:
User-added image
It shows in Metadata API just fine.
User-added image
Replicating the same thing with Metadata API (with help from IntelliJ + Illuminated Cloud) with:
<?xml version="1.0" encoding="UTF-8"?>
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <availability>online</availability>
    <displayType>button</displayType>
    <encodingKey>UTF-8</encodingKey>
    <linkType>page</linkType>
    <masterLabel>FSM_BrianPlaying2</masterLabel>
    <openType>newWindow</openType>
    <page>FSM_ServiceAppointmentDoW</page>
    <position>none</position>
    <protected>false</protected>
    <showsLocation>false</showsLocation>
    <showsStatus>false</showsStatus>
    <fullName>ServiceAppointment.FSM_BrianPlaying2</fullName>
</WebLink>
Then the deployment goes fine, but the button is "nowhere" to be seen.
However, with a bit of SOQL, it turns out that it is there, but on the wrong type.

User-added imageAny ideas on how to fix this?