You need to sign in to do that
Don't have an account?

unable to import custom metadata records using sfdx force:data:tree:import into scratch org
I am trying alternatives to export data and import data using salesforce cli and came across a scenario where I was able to export the custom metadata records but when I try to import the same to another scratch org I am finding CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY entity type cannot be inserted.
{
"records": [
{
"attributes": {
"type": "TR1__mapping__mdt",
"referenceId": "TR1__mapping__mdtRef1"
},
"DeveloperName": "LastName_DefaultValue",
"Label": "LastName DefaultValue",
"Language": "en_US",
"MasterLabel": "LastName DefaultValue",
"QualifiedApiName": "LastName_DefaultValue",
"TR1__Def_Value__c": "UNKNOWN",
"TR1__Field_API__c": "LastName",
"TR1__Node__c": "Contact"
}
]
}
I see that salesforce allows records deployments with ANT but was curious to know why they allowed export feature but import is not working using salesforce cli commands.
force:cmdt:generate
Generates a custom metadata type and all its records for the provided sObject.
force:cmdt:record:create
Create a new record for a given custom metadata type in the current project.
force:cmdt:record:insert
Create new custom metadata type records from a CSV file.
Check the following links for more information:
Create and Manage Custom Metadata Types Using CLI (https://help.salesforce.com/articleView?id=custommetadatatypes_cli.htm&type=5)
cmdt Commands (https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_cmdt.htm#cli_reference_force_cmdt)
https://whispering-escarpment-39582.herokuapp.com/
regards