You are on page 1of 3

Delete Fields

REQUIRED EDITIONS AND USER PERMISSIONS

Available in: both Salesforce Classic and Lightning Experience


Available in: All Editions

USER PERMISSIONS NEEDED


To delete custom fields: Customize Application
AND
View All Data

1. From the management settings for the field’s object, go to Fields.


2. Click Del next to the name of the field.
3. When prompted, select the Yes, I want to delete the custom field checkbox to confirm, and
click Delete.

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. For information on restoring deleted custom fields and
relationships, see Manage Deleted Custom Fields.

NOTE

 Before deleting a custom field, consider where it’s referenced. You can’t delete a custom field that’s referenced
elsewhere. For example, you can’t delete a custom field that’s referenced by a field update or Apex.
 You can’t delete a field if that field is being updated by a background job, such as an update to a roll-up summary field.
Wait until the background job finishes, and then try again.
 When you delete a custom field, all of the field history data is deleted and changes are no longer tracked.
 A background process periodically runs that cleans up metadata associated with deleted custom fields. This process
affects the Last Modified Date and Last Modified By fields on page layouts, record types, and custom
objects.

Manage Deleted Custom Fields


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.

REQUIRED EDITIONS AND USER PERMISSIONS

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

USER PERMISSIONS NEEDED

To restore deleted custom fields and relationships: Customize Application


USER PERMISSIONS NEEDED

To permanently delete custom fields or relationships: Customize Application

The field counts against the maximum number of custom fields allowed in your org until it’s permanently deleted by the hard-
delete process (see Notes on Hard Deleting Custom Fields). A deleted field also counts against the 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. If you receive the error message “Unable to access page” or “No clean data columns available for
custom fields” when trying to create or edit custom fields, you must erase some fields.

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.

Notes on Hard Deleting Custom Fields


 The estimated time for a hard-delete process varies, and depends on the system demand to maintain overall
performance. However, you can monitor and view the details of a hard delete of a custom field by going to the
Background Jobs page. From Setup, enter Background Jobs in the Quick Find box, then select Background
Jobs. A row with the name “Cleanup of custom field data when a custom field definition is hard deleted” indicates that
a hard delete job is in progress. The Background Jobs page also shows the details of background jobs, including a
percentage estimate of the progress.
 When an org is at or above 75% of its custom field allocation limit for the current object, Salesforce displays a value
for the custom fields that are ready for the hard-delete process value. This value increments when you click Erase or
when a field is beyond the 15-day grace period, until the field is moved into the hard-delete process by Salesforce. The
value changes only while Salesforce is actively hard deleting the field.
 Performance and Unlimited Edition orgs can use a Purge button to initiate the hard-delete process immediately.

Manually Restore Attributes of Deleted Fields


Custom fields consist of several attributes that provide additional information about the field. Some of these attributes are not
restored automatically after a field is undeleted and must be restored manually.

REQUIRED EDITIONS AND USER PERMISSIONS

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


USER PERMISSIONS NEEDED
To restore deleted custom fields and relationships: Customize Application
To permanently delete custom fields or relationships: Customize Application

IMPORTANT Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained
certain terms to avoid any effect on customer implementations.

1. 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.
2. Make the field unique if necessary. Salesforce automatically removes the unique attribute from any deleted custom
field.
3. Make the field required if necessary. Salesforce automatically removes the required attribute for any deleted custom
field.
4. Add the custom field to any appropriate Salesforce AppExchange packages. Salesforce automatically removes deleted
custom fields from packages that contain them.
5. Convert lookup relationships to a master-detail relationship 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.
6. Redefine any field dependencies that Salesforce removed when the field was deleted.
7. Edit and save any formula fields. Saving prompts a syntax check; if necessary, resolve errors.
8. 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 setup to track field history.

You might also like