Find your content:

Search form

You are here

Create a custom object via the API (define the object, similar to DDL)


I was looking through the Metadata API (and Partner) but can't find anywhere described how I can define via the API a custom object.

We have specific datasets which have to translate into Custom Objects in Salesforce via the API.

For instance a Home Repair dataset would include: Address, Estimate and Repair Date fields. I want to translate this dataset into a Custom Object (named HomeRepair__c with those 3 custom fields) in Salesforce in our client's account via an API call.

Is this even possible?


Attribution to: Alexandru Luchian

Possible Suggestion/Solution #1

Sure, you can use the Metadata API. You want the create() call. Here's the sample xml to define the custom object from the documentation:

<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="">
    <description>just a test object with one field for eclipse ide testing</description>
        <description>add your comments about this object here</description>
        <inlineHelpText>This field contains comments made about this object</inlineHelpText>
        <label>MyFirstObject Name</label>

Attribution to: Daniel Hoechst
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content