Activity › Forums › Salesforce® Discussions › How to delete custom object programmatically?
-
How to delete custom object programmatically?
Posted by Hazel on April 22, 2016 at 12:30 PMPlease explain how to delete custom object programmatically?
shariq replied 7 years, 7 months ago 4 Members · 3 Replies -
3 Replies
-
We can not delete custom object using apex, bit if you want to delete a custom object we have to use Meta Data api.
- [adinserter block='9']
-
Hi Hajel
We can’t delete a custom Object.Instead we delete a record of custom Object.For perform deletion of Custom Object we have to use Metadata API
Thanks
-
Hi,
Use the CRUD-based metadata calls to create, update, or delete setup and configuration components for your organization or application. These configuration components include custom objects, custom fields, and other configuration metadata. The metadata calls mimic the behavior in the Salesforce user interface for creating, updating, or deleting components. Whatever rules apply there also apply to these calls.
Metadata calls are different from the core, synchronous API calls in the following ways:Metadata API calls are available in a separate WSDL. To download the WSDL, log into Salesforce, from Setup, enter APIin the Quick Find box, then select API and click the Download Metadata WSDL link.
After logging in, you must send Metadata API calls to the Metadata API endpoint, which has a different URL than the SOAP API. Retrieve the metadataServerUrl from the LoginResult returned by your SOAP API login() call. For more information about the SOAP API, see the SOAP API Developer Guide.
Metadata calls are either synchronous or asynchronous. CRUD calls are synchronous in API version 30.0 and later, and similar to the API core calls the results are returned in a single call. In earlier API versions, create, update, and delete are only asynchronous, which means that the results are not immediately returned in one call.
There are synchronous metadata calls that map to the corresponding core SOAP API synchronous calls.createMetadata() maps to the create() SOAP API call.
updateMetadata() maps to the update() SOAP API call.
deleteMetadata() maps to the delete() SOAP API call.Hope this helps!
Log In to reply.