Pages

Tuesday, March 15, 2016

Metadata API Low-Overhead Assistance Sought (For Custom Object and Custom Field Creation)

This "Metadata API" thing is so frustrating. Why?!

I have about a week to:

  1. Rebuild 4 custom objects and about 25% of their 100-or-so-per-object custom fields from one Salesforce org in another - sometimes with slight name changes to avoid conflicts (both are sandboxes, but of unrelated production orgs)
  2. Hook up the "source" Salesforce org's data to the new objects/fields in the "target" Salesforce org via Jitterbit
  3. Write a bazillion triggers to post-process the data once it lands in the "target" org

I am not looking forward to step 1.

Thank goodness for student workers, because so far I've wasted 3 hours trying to figure out just how to take the following XML file and throw it at a Salesforce org w/o a "zzzTestSmallObject__c" custom object and get it to create one (along with "BoolCustField__c" custom field).

Any step-by-step advice on the fastest way to do this?

All "intros" to manipulating metadata with the API seem geared at getting people set up who need a lot of power.

I just need to take little XML files like this and create objects/fields from them on an ad-hoc basis.

And then I never want to think about the Metadata API again.

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <actionOverrides>
        <actionName>Accept</actionName>
        <type>Default</type>
    </actionOverrides>
    <actionOverrides>
        <actionName>CancelEdit</actionName>
        <type>Default</type>
    </actionOverrides>
    <actionOverrides>
        <actionName>Clone</actionName>
        <type>Default</type>
    </actionOverrides>
    <actionOverrides>
        <actionName>Delete</actionName>
        <type>Default</type>
    </actionOverrides>
    <actionOverrides>
        <actionName>Edit</actionName>
        <type>Default</type>
    </actionOverrides>
    <actionOverrides>
        <actionName>Follow</actionName>
        <type>Default</type>
    </actionOverrides>
    <actionOverrides>
        <actionName>List</actionName>
        <type>Default</type>
    </actionOverrides>
    <actionOverrides>
        <actionName>New</actionName>
        <type>Default</type>
    </actionOverrides>
    <actionOverrides>
        <actionName>SaveEdit</actionName>
        <type>Default</type>
    </actionOverrides>
    <actionOverrides>
        <actionName>Tab</actionName>
        <type>Default</type>
    </actionOverrides>
    <actionOverrides>
        <actionName>View</actionName>
        <type>Default</type>
    </actionOverrides>
    <compactLayoutAssignment>SYSTEM</compactLayoutAssignment>
    <deploymentStatus>Deployed</deploymentStatus>
    <description>zzzTestSmallObjectHasADescription</description>
    <enableActivities>false</enableActivities>
    <enableBulkApi>true</enableBulkApi>
    <enableFeeds>false</enableFeeds>
    <enableHistory>false</enableHistory>
    <enableReports>false</enableReports>
    <enableSharing>true</enableSharing>
    <enableStreamingApi>true</enableStreamingApi>
    <fields>
        <fullName>BoolCustField__c</fullName>
        <defaultValue>false</defaultValue>
        <description>ThisIsABoolCustField</description>
        <externalId>false</externalId>
        <inlineHelpText>ThisIsABoolCustField</inlineHelpText>
        <label>BoolCustField</label>
        <trackTrending>false</trackTrending>
        <type>Checkbox</type>
    </fields>
    <label>zzzTestSmallObject</label>
    <nameField>
        <label>zzzTestSmallObject Name</label>
        <type>Text</type>
    </nameField>
    <pluralLabel>zzzTestSmallObjects</pluralLabel>
    <searchLayouts/>
    <sharingModel>ReadWrite</sharingModel>
</CustomObject>

No comments:

Post a Comment