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
GarrettzGarrettz 

Deleting Record Types using Force.com Migration Tool

This is my first time using the migration tool, so I'm not sure if it's user error or if it's not supported.

I posed a question on StackExchange (http://salesforce.stackexchange.com/questions/46154/is-it-possible-to-delete-a-record-type-through-metadata-api/46156?noredirect=1#comment60102_46156) which I'm fairly certain confirms it can be done.

I built a destructiveChanges.xml file which I'm able to successfully deploy without the elements for RecordType. When I add them into the file and deploy, I get an error reading "Error: Cannot delete record type through API". As mentioned in the StackExchange question, the Metadata API guide states "Use this metadata type to create, update, or delete record type definitions for a custom object.", so I'm at a bit of a loss.

I have 4 record types (all for the standard object Case), and they are all inactive and not default for any profiles.

Has anyone ever been able to delete a record type using a destructiveChanges.xml file? Here is my code referencing RecordType:

<types>
	<members>case.Associate_Services</members>
	<members>case.InformationTechnology</members>
	<members>case.Operational</members>
	<members>case.Website</members>
	<name>RecordType</name>
</types>

Best Answer chosen by Garrettz
kaustav goswamikaustav goswami
I checked the access level for the RecordType object through the schema explorer. The following access levels were mentioned - createable, queryable, replicatable, retrieveable, updateable. It does not say that it is deletable through the api. Thus I think if you try to delete record type records from the record type pbject you will be receiving that error.

Thanks,
Kaustav

All Answers

kaustav goswamikaustav goswami
I checked the access level for the RecordType object through the schema explorer. The following access levels were mentioned - createable, queryable, replicatable, retrieveable, updateable. It does not say that it is deletable through the api. Thus I think if you try to delete record type records from the record type pbject you will be receiving that error.

Thanks,
Kaustav
This was selected as the best answer
davcondevdavcondev
Salesforce support will refer you to this question if you raise a case about this.

@kaustav you should ask for MVP recognition like a badge or something :)