+ Start a Discussion
GenoudGenoud 

Converting project from Metadata to SFDX with RecordType referencing GlobalValueSet causing reference error on push

hello everyone,

I converted my project from metadata to sfdx. When I push, I have this error 
Global Picklist 'GlobalValueSetName' is not allowed as record type picklist. Field name should be specified instead (8906:25)
Here is The RecordType Metadata from metadata API.
<recordTypes>
        <fullName>RecordTypeName</fullName>
        <active>true</active>
        <description>RecordType Description</description>
        <label>RecordTypeLAbel</label>
        <picklistValues>
            <picklist>GlobalValueSetName</picklist> <!-- In SFDX I need to put here the field name for this to work. -->
            <values>
                <fullName>Value1</fullName>
                <default>true</default>
            </values>
            <values>
                <fullName>Value2</fullName>
                <default>false</default>
            </values>
            <values>
                <fullName>Value3</fullName>
                <default>false</default>
            </values>
        </picklistValues>
    </recordTypes>
I need to replace the GlobalValueSetName in the converted project with the associated CustomField Name before push. This is time consuming as there are many occurences. 

How to solve this issue?

Thanks
Raj VakatiRaj Vakati
Change your package.xml as shown below and then retrieve it.  I dnt see any issues

 
sfdx force:mdapi:retrieve -r ./mdapipkg -u my-dev-org1 -k  C:\Users\rvakati\workspace\RajV\src\package.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>CustomObject</name>
    </types>
      <types>
        <members>aaaaaa</members>
        <name>GlobalPicklist</name>
    </types>
    <version>38.0</version>
</Package>




 
 
Raj VakatiRaj Vakati
User-added image
Xiukai NingXiukai Ning
Genoud, were you able to solve the problem? I'm experiencing the same issue, and couldn't get around it unless I replace the global value set name with the field name.