function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Frédéric ProvotFrédéric Provot 

Error Importing Duplication Rules via Change Sets or ANT : bad value for restricted picklist field: RecordTypeId

Hi 
I managed to find out how to pass this bug so I give you the clue that can help.

Problem
- I have defined a duplicate rule with some conditions, especially a condition on the Account recordtype. The rule works fine on the sandbox.
- I want to migrate it to another org that have the exact same Account recordtypes.

With changeset : the validation fails with error "Field: bad value for restricted picklist field: RecordTypeId"
With Ant Migration tool : the import fails with the same error!

I managed finally after a while to import it with Ant by manually modifying the xml file as this:
Xml file exported with ant retrieve contains:

        <duplicateRuleFilterItems>
            <field>RecordTypeId</field>
            <operation>notEqual</operation>
            <value>ADD Address</value>
            <sortOrder>2</sortOrder>
            <table>Account</table>
        </duplicateRuleFilterItems>

modified as:
        <duplicateRuleFilterItems>
            <field>RecordType</field>     <= NOT THE ID!
            <operation>notEqual</operation>
            <value>ADD Address</value>
            <sortOrder>2</sortOrder>
            <table>Account</table>
        </duplicateRuleFilterItems>        
        
I tried with API versions 40 and below.

So the Ant export and import of the xml file don't respect the same specification! Same with Changesets.
I call that a bug, surprised also that it's not yet mentionned in some other posts.

Hope this helps,
regards
SY Chan 7SY Chan 7
Thank you Frédéric ! Just reported this issue to Salesforce Support and they have marked this as Known Issue:
Link: https://success.salesforce.com/issues_view?id=a1p3A0000001Cp8QAE
where the fix is scheduled in the next release Spring '18..
Frédéric ProvotFrédéric Provot
Hello,
Yes I think the issue has been raised after my request to the support.
Good to know it will be fixed.
Regards.