Loading
Feature degradation | Gmail Email delivery failureRead More
Extend Salesforce with Clicks, Not Code
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Considerations for Converting the Field Type of a Custom Field

          Considerations for Converting the Field Type of a Custom Field

          Before you convert a custom field from one type to another, review these considerations.

          Important
          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.

          Considerations for Potential Data Loss from Converting a Custom Field's Type

          • To avoid losing data, only convert custom fields that have no data to avoid losing data. Changing the data type of an existing custom field can cause data loss in these situations.
            • Changing to or from type Date or Date/Time
            • Changing to Number from any other type
            • Changing to Percent from any other type
            • Changing to Currency from any other type
            • Changing from Checkbox to any other type
            • Changing from Picklist (Multi-Select) to any other type
            • Changing to Picklist (Multi-Select) from any other type

              Currently defined picklist values are retained when you change a picklist to a multi-select picklist. If records contain values that aren’t in the picklist definition, those values are deleted from those records when the data type changes.

            • Changing from Auto Number to any other type
            • Changing to Auto Number from any type except Text
            • Changing from Text to Picklist
            • Changing from Text Area (Long) to any type except Email, Phone, Text, Text Area, or URL
          • If data is lost, any list view based on the custom field is deleted, and assignment and escalation rules can be affected.

          Considerations for Changing a Custom Field's Data Type

          • You can’t change the data type of any custom field that is mapped for lead conversion.
          • If you change the data type of a custom field that’s set as an external ID, choosing a data type other than text, number, or email causes the field to no longer act as an external ID.
          • The option to change the data type of a custom field isn’t available for all data types. For example, an existing custom field can’t be converted into an encrypted field nor can an encrypted field be converted into another data type.
          • In Salesforce Knowledge article types, the file field type can’t be converted into other data types.
          • You can’t change the data type of a custom field referenced by other items in Setup such as Visualforce pages, Apex code, processes, or flows.
          • Before changing a custom field’s type, make sure that it isn’t the target of a workflow field update or referenced in a field update formula that would be invalidated by the new type.
          • If you encrypt a custom field by using Shield Platform Encryption, you can’t change the field type.
          • If you change a custom field data type via the metadata deploy() method or a package upgrade and the deployment fails with an error related to custom field data types, see this knowledge article. This error can occur if a deployment changes the data type of one or more custom fields and the objects that contain the affected custom fields contain a large amount of data. The limit is 85 million custom field type conversions. For example, if you have an object with 30 million records, and you change three text fields to picklists, that's a total of 90 million field type conversions, which is over the limit.
          • When you change a custom field data type, the conversion runs in the background. The conversion can take a while depending on the size of the custom field, the number of records affected, and the type of field conversion. In some cases, the conversion can take over 24 hours to complete. These field data type changes take the longest.
            • Changing from Picklist to Text, Picklist (Multi-Select), or Checkbox
            • Changing from Text to Picklist
            • Change from Date/Time to Time
            • Changing from Time to Text
          • Changing a custom field type can require changing many records at once. If your request is queued to process these changes, you receive an email notification when the process has completed.

          Data Type Restrictions

          These data types have other restrictions when you convert them.

          Data Type Description
          Auto Number If you convert an auto-number field into a text field, the data in that field remains unchanged. Also, you can safely convert a text custom field into an auto-number field without losing your data. Converting an auto-number field into any other data type results in data loss. Auto-number fields can contain a maximum of 30 characters. Before converting a text custom field into an auto-number field, change any records that contain more than 30 characters in that field.
          Formula Formula fields are special read-only fields that can’t be converted to any other data type. Likewise, you can’t convert any other field type into a formula field.
          Picklist Changing your custom picklists into custom checkboxes is simple. If you select Checkbox as the new data type, you can choose which picklist values to map to checked boxes and unchecked boxes. You can change custom picklists into multi-select picklists without losing any data. Since your records contain only a single value of that picklist, that value is still selected but users can select more values.
          Relationships
          • You can convert relationship fields to nonrelationship fields and vice versa, but only on external objects.
          • If your org has a large number of records, Salesforce displays a waiting page after you request to change a master-detail into a lookup relationship or a lookup into a master-detail relationship.
          • Converting a field from a master-detail into a lookup relationship or vice versa can fail if the number of affected records is very large.
          • After you create a roll-up summary field on an object, you can’t convert the object’s master-detail relationship into a lookup relationship.
          • If any records on an object have a null value set for the lookup field, you can’t convert the lookup relationship to a master detail relationship.
          • If you convert a master-detail relationship to a lookup for a custom object on the “detail” side, the org-wide default for the object is automatically updated to Public Read/Write. Similarly, converting a lookup to a master-detail-relationship changes the org-wide default to Controlled by Parent.
          Text

          By default, an upper bound limit of 4,000 is applied to inactive unrestricted picklists for each field. If you exceed this limit when converting a text field to a picklist field, you receive an error message. You can’t convert a defined unique text field to a picklist or a multi-select picklist.

          If you deploy an object definition in package.xml and convert a field in that object from a text field to a picklist field, the label of each picklist value is the value’s fullName.

          Text Area (Long) When you convert a long text area field to an Email, Phone, Text, Text Area, or URL type field, the record data is truncated to the first 255 characters of the field.
          Text Area (Rich) You can convert rich text area fields into long text area fields only. Any images get deleted the next time you save the long text area field. After converting, markup is hidden in the long text area field, but it isn’t removed from the record, so if you change your mind, you can restore the markup before you save the record.
           
          Loading
          Salesforce Help | Article