2

When using force:source:deploy with a package.xml we have the following error

Error Contract__c.ContractNumber__c Property 'allowNullValues' not valid in version 55.0

Everything was fine until yesterday where it's not impossible to deploy a custom field using an index, because of a property allowNullValues which is not even present in the source XML

Custom field XML

<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>ContractNumber__c</fullName>
    <caseSensitive>true</caseSensitive>
    <externalId>true</externalId>
    <label>Numéro du contrat</label>
    <length>255</length>
    <required>false</required>
    <trackFeedHistory>false</trackFeedHistory>
    <trackHistory>false</trackHistory>
    <trackTrending>false</trackTrending>
    <type>Text</type>
    <unique>true</unique>
</CustomField>

Custom index XML

<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata"/>

I also tried by adding allowNullValues in the custom index, but the result is the same

Do anyone know how to solve this issue ?

4
  • At least it works if you use API 56.0, but then you can have other issues (for instance Global Value Set metadata has changed is API 56.0). So you may not have a whole project that can be deployed in 1 deployment, but as a workaround I deployed my project excluding CustomIndex in API 55.0, switched to API 56.0 and deployed only them. Sep 2, 2022 at 12:54
  • Because from what I've seen, it's only failing in Winter '23 orgs. Sep 2, 2022 at 12:55
  • We have a go live soon in an org that will still be in Summer22... can't "56'se" the sources :/ I'll try excluding CustomIndexes , that could be a workaround.... thanks ! Sep 2, 2022 at 12:58
  • 1
    Issue seem to be in winter'23 org's, have reached out to concern team and will update thread once I have more details.
    – Vinay
    Sep 2, 2022 at 18:44

3 Answers 3

3

This is now an official Known Issue, you can subscribe to it to get notified when it will be fixed: https://trailblazer.salesforce.com/issues_view?title=metadata-api-deploy-error-custom-index-allownullvalues-is-not-valid-in-version-55-0-in-winter-release-orgs&Id=a1p4V000002an7L

0

Same problem here:

  • Project is on API version 55.0
  • Scratch or Sandbox is on Winter '23 Preview (API Version 56.0)
  • Trying to push custom indexes to a Winter '23 org using API version 55.0 gives errors like:
Error customindex/Product2.ExternalID__c.indx 
Product2.ExternalID__c 
Property 'allowNullValues' not valid in version 55.0

Only workaround that I found was to update 'sourceApiVersion' in sfdx-project.json to 56.0, but since in our project this file is in version control, this would also affect our production-deployments, and that org is still on 55.0.

The expected behavior would of course be that you can push 55.0 metadata to an 56.0 org without issue, by leaving your 'sourceApiVersion' at 55.0. But with these custom indexes that apparently doesn't work :-(

-1

The allowNullValues flag is a new attribute in API version 56. As per documentation exporting metadata with a higher API version and importing into a lower API version is not supported and is expected to fail.

To import a metadata file that was exported using version 56, the import must use version 56. To import into an org where version 56 is not yet available, the export must be done using version 55.

1
  • That doesn't seem like a solution. I pulled code from my scratch org and now I can't deploy it to my sandbox org. This kind of thing happens every time. I can't believe your tooling is so bad. Sep 29, 2022 at 6:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .