I have a record type that has been deprecated. I'd like to drop the table from the database and rename the record type to start with DEPRECATED; then disable data sync and disconnect the table. However this record will become invalid and fail to deploy. What's the best practice?
Discussion posts and replies are publicly visible
I think the most important step is to restrict access by modifying the security settings and deploying that change to all environments.
After making sure that there are no dependencies anymore, you will have to manually delete the record and drop the table on all environments. While you could drop a table using a deployment SQL script, that would break the record without the option to delete that record through a deployment.
Good suggestion on security.
Are you suggesting it is possible to delete the record through a deployment? As far as I know, deletion is manual and cannot be done through a deployment.
In addition to changing the security settings, it would also be interesting to change the registry description (Adding DEPRECATED), to warn users to stop using that record (I think it's better than change object name)
A deployment cannot delete an object. That's why I mentioned doing this manually.
Wen Huynh I agree with Stefan Helzle as we faced this issue.We perform manually delete the record and drop the table on all environments.
What I usually do is transform it into a service backed Record Type with an empty recordDataSource. You mark it as deprecated, deploy it everywhere. You can then drop the tables. Once all that is done, you can go ahead and remove the Record in all your environments.