SFDX, when using pull command on Custom metadata types you see an error: Custom metadata type …__mdt is not available in this organization.
Last updated 2018-02-16 ·Reference W-4594495 ·Reported By 3 users
Custom Metadata Records created in scratch orgs don't get detected by source:pull if these records are created against a Custom Metadata Type associated with a managed package.
ERROR: Custom metadata type …__mdt is not available in this organization.
1) Create a Custom Metadata Type CMT1 in a Developer Edition org and add it to a managed package (first-generation managed package)
2) Install the managed package in a scratch org.
3) Create 2 custom metadata records in the scratch org for CMT1 - cmt1-rec1 and cmt1-rec2.
4) Do an sfdx force:source:pull
Expected Result - the CMT records are pulled as part of source pull
Actual Result - ERROR: Custom metadata type CMT1__mdt is not available in this organization.
Download the Custom Metadata records using the Metadata API and include them in the sfdx project.
1) mkdir .tmp
2) Save the following to .tmp/package.xml
<?xml version="1.0" encoding="UTF-8"?>
3. Run 'sfdx force:mdapi:retrieve --retrievetargetdir .tmp/ --wait 5 --unpackaged .tmp/package.xml'
4. Unzip .tmp/unpackaged.zip and copy unpackaged/customMetadata/*.md to into the sfdx project but rename the file extensions from ".md" to ".md-meta.xml".
5. Run 'sfdx force:source:push' will deploy the records. Thus 'sfdx force:source:pull' will no longer attempt to extract the custom metadata record since it is no longer "newer" in the scratch org.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.