Skip to main content

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

Possible causes and solutions to "Invalid data type" Salesforce validation error

Mykyta Nechepurenko avatar
Written by Mykyta Nechepurenko
Updated over a week ago

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.

Disclaimer: This error is returned by Salesforce directly, rather than Gearset. Even so, we offer guidance based on our combined experience with the Metadata API. Where possible, we try to help guide you to fix or avoid this error. In the case that this isn't possible, we may need to direct you to Salesforce support for further clarification.

Did this answer your question?