function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jay JanarthananJay Janarthanan 

Erasing Fields on a Custom object using IDE or API

Can this be done ?

Every time I erase a field name by taking out the whole XML that defins the field like

<fields> <fullName>Comments__c</fullName> <description>add your comments about this object here</description> <inlineHelpText>This field contains comments made about this object</inlineHelpText> <label>Comments</label> <length>32000</length> <type>LongTextArea</type> <visibleLines>30</visibleLines> </fields>

and save to the server , nothing happens and my local copy get refreshed with the orignial schema. 

I thought about developing my own code using the MetaDataAPI but looks like del function is not supported ?


Best Answer chosen by Jay Janarthanan
Rajiv Bhatt 16Rajiv Bhatt 16
If you going to do this in Apex then i would highly recommend using the "Apex Wrapper Salesforce Metadata API" by Andrew Fawcett, it has a method to delete custom fields:

Check deleteField() method on this page
Another alternative is: