+ Start a Discussion
Binh PhuBinh Phu 

How to delete custom object programmatically

Good morning everyone,
I am new to SF and I'd like to know how can I delete a SF custom object programmatically?  Currently I am manually going to custom object itself and manually truncate it.
Thank you for your advise.

You would need to use the metadata api for this, you can't do it via Apex I'm afraid.
Ajay K DubediAjay K Dubedi
Hi Binh,
The Force.com platform provides a rich and powerful metadata model and Metadata API. Platform metadata describes your application and the API encompasses a set of methods that provide programmatic access to the configuration and source of your application. The Meta data API in salesforce is a perfect soultion for this. The following link gives a good example to learn how to do Metadata changes programatically.
Binh PhuBinh Phu
Thank  you everyone.  I will read those documents.

Have a great one!