Deleted custom fields and their data are stored until your org permanently deletes them or 15 days has elapsed, whichever happens first. Until that time, you can restore the field and its data.
|Available in: both Salesforce Classic and Lightning Experience|
|Available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions|
Page Layouts and Lead Fields are not available in Database.com
|To restore deleted custom fields and relationships:||“Customize Application”|
|To permanently delete custom fields or relationships:||“Customize Application”|
However, the field still counts against the maximum number of custom fields allowed in your organization. A deleted field also counts against any applicable limit for its field type. For example, a deleted custom roll-up summary field counts against the maximum number of roll-up summary fields for your Salesforce edition.
- From the management settings for the field’s object, go to Fields.
- Click Deleted Fields at the bottom of the list of custom fields and relationships. The number in parentheses indicates the total number of deleted custom fields for this object. This link only displays when you have a deleted custom field.
- Use the list of deleted fields to perform the following actions:
- To view details about a field, click the field label.
- To permanently remove the custom field and its data, click Erase.
- To restore the field and its data, click Undelete. Some attributes of deleted fields are not restored automatically. To restore these attributes manually:
- Add the field to any page layouts that changed during the time the custom field was deleted. If reports and page layouts were not edited, the restored field remains on them.
- Make the field unique if necessary. Salesforce automatically removes the unique attribute from any deleted custom field.
- Make the field required if necessary. Salesforce automatically removes the required attribute for any deleted custom field.
- Add the custom field to any appropriate Force.com
AppExchange packages. Salesforce automatically removes deleted custom fields from packages that contain them.
- Convert any lookup relationships to master-detail relationships if necessary. Salesforce converts all relationships to lookup relationships when they are deleted. To convert a lookup relationship to a master-detail relationship, populate all the applicable records with the appropriate data.
- Redefine any field dependencies that Salesforce removed when the field was deleted.
- Edit and save any formula fields. Saving prompts a syntax check; if necessary, resolve errors.
- Set up field history tracking if necessary. If the list of fields enabled for history tracking was modified during the deletion process, the restored field is no longer set up to track field history.
Notes on Restored Custom Fields
- When deleted, the following characters are appended to the end of a custom field's developer name unless a deleted field already has that developer name: “_del”. These characters remain when you restore the custom field.
- Formula fields are restored in a disabled state, which means they do not contain updated data until you edit and save them. While a formula field is disabled, “#Error!” displays in place of the formula value.
- Restored fields do not display in search results immediately after you restore them. It can take a short time before the restored custom field and its data are available in search results.
- Lead fields that are mapped to account, contact, or opportunity fields for lead conversion are still mapped accordingly when restored.
- Auto number fields continue to increment after they are deleted and contain the correct values when restored.
- Field history data for the deleted custom field is restored.