• #25920
     kapil #45
    Forcetalks

    How to create custom objects/setting using Apache Ant in Salesforce?

    How to create custom objects/setting using Apache Ant in Salesforce?

    Tagged: , , , , ,

    #25945
     Ratnakar #30
    Forcetalks

    Hi Kapil,

    we cannot create objects using Apache ant but we can migrate objects from one salesforce org to another
    Following are the steps to migrate objects from one org to another:
    1.In the build.properties specify the username and password of the source and destination org.
    2.In the package.xml specify the name of object you want to retrieve.
    3.your build.properties look like this
    # build.properties
    #

    # Specify the login credentials for the desired Salesforce organization
    sf.username=sourceorg@salesforce.com
    sf.password=xxxxxxxxxxxxxxxxx

    sf1.username=destinationorg@salesforce.com
    sf1.password=xxxxxxxxxxxxxxxxx
    #sf.sessionId = <Insert your Salesforce session id here. Use this or username/password above. Cannot use both>
    #sf.pkgName = <Insert comma separated package names to be retrieved>
    #sf.zipFile = <Insert path of the zipfile to be retrieved>
    #sf.metadataType = <Insert metadata type name for which listMetadata or bulkRetrieve operations are to be performed>

    # Use ‘https://login.salesforce.com’ for production or developer edition (the default if not specified).
    # Use ‘https://test.salesforce.com for sandbox.
    sf.serverurl = https://login.salesforce.com
    sf1.serverurl = https://login.salesforce.com

    sf.maxPoll = 120
    sf1.maxPoll = 120
    # If your network requires an HTTP proxy, see http://ant.apache.org/manual/proxy.html for configuration.
    #

    4.your package.xml look like this

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <Package xmlns=”http://soap.sforce.com/2006/04/metadata”>
    <types>
    <members>specify the name of custom object</members>
    <name>CustomObject</name>
    </types>
    <version>40.0</version>
    </Package>
    5.command to retrieve object
    ant retrieveUnpackaged

    6.command to deploy object
    ant deployUnpackaged

Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2018 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?