Create Custom objects through Workbench

Consider a scenario: I want to deploy a custom object from one developer account to another. Easiest way to do this is through workbench Metadata API.

Let’s login into the workbench ( https://workbench.developerforce.com ) of my developer account. I have a custom object called Hobbies__c which I want to deploy to my second Salesforce developer account.

Also, create the following code in a notepad and save it as package.xml.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Hobbies__c</members>
        <name>CustomObject</name>
    </types>
    <version>45.0</version>
</Package>

From the workbench, go to Migration-Retrieve and upload the package.xml file. Click Next, Click Retrieve and Download the Zip file from the next screen.

Create Custom object through Workbench

As a next step, logout of the workbench and login again with the second developer account.

Click Migration->Deploy, Upload the Zip file and Click Next. Click Deploy in the next screen and your package will be successfully deployed. The metadata API will create the custom object using the definition that you exported from the original developer account.

Now both your accounts have the same custom object definition.

The process in quite similar to deleting an Apex class which I have posted here.

Read more about Metadata API here.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top