Skip to content

Instantly share code, notes, and snippets.

@takahiro-yonei
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takahiro-yonei/54a6e4f32ad481a9d91b to your computer and use it in GitHub Desktop.
Save takahiro-yonei/54a6e4f32ad481a9d91b to your computer and use it in GitHub Desktop.
salesforce-custommetadata sample
<!-- ReusablePicklist.Motel.md -->
<?xml version="1.0" encoding="UTF-8"?>
<CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<label>Motel</label>
<values>
<field>Picklist__c</field>
<value xsi:type="xsd:string">Hotels</value>
</values>
<values>
<field>SortOrder__c</field>
<value xsi:type="xsd:double">4.0</value>
</values>
</CustomMetadata>
<!-- ReusablePicklist.Planets.md -->
<?xml version="1.0" encoding="UTF-8"?>
<CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<description>All the planets in the solar system. Does not
include asteroids.</description>
<label>Planets</label>
<values>
<field>Picklist__c</field>
<value xsi:type="xsd:string">Planets</value>
</values>
<values>
<field>SortOrder__c</field>
<value xsi:nil="true"/>
</values>
</CustomMetadata>
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>CustomMetadata</name>
</types>
<types>
<members>ReusablePicklist__mdt</members>
<name>CustomObject</name>
</types>
<version>34.0</version>
</Package>
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<fields>
<fullName>Picklist__c</fullName>
<externalId>false</externalId>
<label>Picklist</label>
<length>40</length>
<required>true</required>
<type>Text</type>
<unique>false</unique>
</fields>
<fields>
<fullName>SortOrder__c</fullName>
<externalId>false</externalId>
<label>Non-Alphabetical Sort Order</label>
<precision>3</precision>
<required>false</required>
<scale>0</scale>
<type>Number</type>
<unique>false</unique>
</fields>
<label>Reusable Picklist Option</label>
<visibility>Protected</visibility>
</CustomObject>
@takahiro-yonei
Copy link
Author

gistfile1.xml -> ファイル名は ReusablePicklist.Motel.md としてください。
gistfile2.xml -> ファイル名は ReusablePicklist.Planets.md としてください。


【フォルダ構成】

src
 ┣ customMetadata
 ┃ ┣ ReusablePicklist.Motel.md
 ┃ ┗ ReusablePicklist.Planets.md
 ┣ objects
 ┃ ┗ ReusablePicklist__mdt.object
 ┗ package.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment