Object Metadata
These are the key structures in the metadata file for an Object. This is from the Account object.
Fields
<!-- Text Field --> <fields> <fullName>ABN__c</fullName> <externalId>false</externalId> <label>ABN</label> <length>12</length> <required>false</required> <trackFeedHistory>false</trackFeedHistory> <trackHistory>false</trackHistory> <type>Text</type> <unique>false</unique> </fields> <!-- Text Field - with Help Text --> <fields> <fullName>Bank_Account_Number__c</fullName> <description>Bank Account Number</description> <externalId>false</externalId> <inlineHelpText>Bank Account Number</inlineHelpText> <label>Bank Account Number</label> <length>10</length> <required>false</required> <trackFeedHistory>false</trackFeedHistory> <trackHistory>false</trackHistory> <type>Text</type> <unique>false</unique> </fields> <!-- Picklist Field --> <fields> <fullName>Industry</fullName> <picklist> <!-- Each Picklist Value has a few lines to set the value --> <picklistValues> <fullName>Agriculture</fullName> <default>false</default> </picklistValues> <picklistValues> <fullName>Apparel</fullName> <default>false</default> </picklistValues> <!-- removed for brevity --> <picklistValues> <fullName>Utilities</fullName> <default>false</default> </picklistValues> <!-- Then the Picklist field has a few settings --> <sorted>false</sorted> </picklist> <trackFeedHistory>false</trackFeedHistory> <type>Picklist</type> </fields> <!-- Currency Field --> <fields> <fullName>Rate__c</fullName> <externalId>false</externalId> <label>Rate</label> <precision>18</precision> <required>false</required> <scale>2</scale> <trackFeedHistory>false</trackFeedHistory> <trackHistory>false</trackHistory> <type>Currency</type> </fields> <!-- Checkbox Field --> <fields> <fullName>TriggerWorkflow__c</fullName> <defaultValue>false</defaultValue> <description>Used Only to trigger workflows on existing records.</description> <externalId>false</externalId> <label>TriggerWorkflow</label> <trackFeedHistory>false</trackFeedHistory> <trackHistory>false</trackHistory> <type>Checkbox</type> </fields>
An example custom field. You can see all of the regular names of things you find in the Salesforce setup when creating a field in the regular way. Imagine how easy it will be to update the help text of the fields that are missing it.
List Views
<listViews> <fullName>Test</fullName> <columns>ACCOUNT.NAME</columns> <columns>ACCOUNT.ADDRESS1_STATE</columns> <columns>ACCOUNT.PHONE1</columns> <columns>ACCOUNT.TYPE</columns> <columns>ACCOUNT.RECORDTYPE</columns> <columns>CORE.USERS.ALIAS</columns> <filterScope>Everything</filterScope> <filters> <field>ACCOUNT.RECORDTYPE</field> <operation>notEqual</operation> <value>Account.MyRecordType</value> </filters> <label>Test</label> </listViews>
Imagine how easy it will be to quickly create a few list views for different record types and ensuring they are ALL exactly the same.
Record Types
<recordTypes> <fullName>Test_RT</fullName> <active>true</active> <description>Testing creating a Record Type</description> <label>Test Record Type</label> <picklistValues> <picklist>A Picklist</picklist> <values> <fullName>Picklist Value</fullName> <default>false</default> </values> <!-- All Picklist Names are listed under each Record Type - remember this if ever changing picklist values --> </picklistValues> </recordTypes>
Search Layouts
<searchLayouts> <!-- Edited for brevity --> <customTabListAdditionalFields>ACCOUNT.NAME</customTabListAdditionalFields> <lookupDialogsAdditionalFields>ACCOUNT.NAME</lookupDialogsAdditionalFields> <lookupFilterFields>ACCOUNT.NAME</lookupFilterFields> <lookupPhoneDialogsAdditionalFields>ACCOUNT.NAME</lookupPhoneDialogsAdditionalFields> <searchResultsAdditionalFields>ACCOUNT.NAME</searchResultsAdditionalFields> </searchLayouts>
If you are not sure what each of these does, edit them in the regular user interface, then update Mavens Mate so it helps to make sense. Then you can try to get some consistency throughout your app by quickly setting the right values and then saving the object. See https://www.salesforce.com/us/developer/docs/api_meta/Content/meta_searchlayouts.htm for more details.
Validation Rules
<validationRules> <fullName>Billing_State_in_Aus</fullName> <active>true</active> <description>Check that the Billing State is correct in AUS</description> <errorConditionFormula>AND ( OR(BillingCountry = "Australia", BillingCountry="Aus", ISBLANK(BillingCountry)), OR( LEN(BillingState) < 2, NOT( CONTAINS("WA:SA:NT:NSW:QLD:VIC:ACT:TAS", BillingState) )))</errorConditionFormula> <errorDisplayField>BillingState</errorDisplayField> <errorMessage>The state must be a valid Australian State. WA,SA,NT,NSW,QLD,VIC,ACT,TAS, or enter a Country other than Australia.</errorMessage> </validationRules>
Note, the formula doesn't look like it does in the setup screens, so maybe just do a simple formula in MM if creating a new field, then go in and edit the formula in setup.
Buttons, Links and Actions
<webLinks> <fullName>GoogleMaps</fullName> <availability>online</availability> <displayType>link</displayType> <encodingKey>UTF-8</encodingKey> <hasMenubar>false</hasMenubar> <hasScrollbars>true</hasScrollbars> <hasToolbar>false</hasToolbar> <height>600</height> <isResizable>true</isResizable> <linkType>url</linkType> <masterLabel>Google Maps</masterLabel> <openType>newWindow</openType> <position>none</position> <protected>false</protected> <showsLocation>false</showsLocation> <showsStatus>false</showsStatus> <url>http://maps.google.com/maps?f=q&hl=en&q={!Account_BillingStreet}+{!Account_BillingCity}+{!Account_BillingState}&om=1</url> </webLinks>
Note that Web Links, Buttons and Actions are all similar - a Button just has a <displayType> of Button and a few extra fields. Again, if you are not sure, then make one in the Setup screens, then refresh MM to see how it is structured.