Skip to main content

Resolving validation errors - "Invalid data type" on Custom Address field

Possible causes and solutions to this Salesforce validation error

Mykyta Nechepurenko avatar
Written by Mykyta Nechepurenko
Updated this week

Explanation of the error

You may come across this validation error when deploying Custom Address field to a target environment where the Custom Address fields feature is disabled.

Example of Custom Address Field (XML)

<fields>
<fullName>Test_Address__c</fullName>
<label>Test Address</label>
<trackFeedHistory>false</trackFeedHistory>
<type>Address</type>
</fields>

Resolution

If the Custom Address fields feature is not enabled in the target org, Salesforce does not recognize Address as a valid field type, and Gearset’s deployment fails with the “Invalid data type” error. To deploy Custom Address fields successfully, they need to be enabled in both source and target. To enable, please follow these steps:

  1. Navigate to your target Salesforce org.

  2. Go to Setup, search for "User Interface" and select User Interface

  3. Scroll down to the Setup section, select Use custom address fields and Save.

What if you can’t enable it?

In some cases, you may not be able (or want) to enable Custom Address fields in a target org. If that’s the case, you’ll need to:

  • Exclude the fields from your Gearset deployment package, or

  • Refactor your metadata to avoid dependencies on Custom Address fields.

Did this answer your question?