forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
494 stars 78 forks source link

force:cmdt:record:insert is creating undefined xsd for all entity relationship field types #1102

Closed agentgill closed 2 years ago

agentgill commented 3 years ago

Summary

Creating custom metadata records using the command below is resulting in undefined xsd for any metadata relationship type field (Entity Definition, Field Definition or Entity Particle)

sfdx force:cmdt:record:insert -d force-app/main/default/customMetadata \
-f cmtd-records.csv \
-i force-app/main/default/objects \
-t IntegrationMapping
<?xml version="1.0" encoding="UTF-8"?>
<CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <label>Contacts_Email</label>
    <protected>false</protected>
    <values>
        <field>APIName__c</field>
        <value xsi:type="xsd:string">CloserXchange.V2.Contacts</value>
    </values>
    <values>
        <field>DataType__c</field>
        <value xsi:type="xsd:string">DT_VALUE</value>
    </values>
    <values>
        <field>DefaultValue__c</field>
        <value xsi:nil="true"/>
    </values>
    <values>
        <field>Field__c</field>
        <value xsi:type="xsd:undefined">Email</value>
    </values>
    <values>
        <field>IntegrationName__c</field>
        <value xsi:type="xsd:string">Closer Update</value>
    </values>
    <values>
        <field>JSONPath__c</field>
        <value xsi:type="xsd:string">Contacts.Email</value>
    </values>
    <values>
        <field>Object__c</field>
        <value xsi:type="xsd:undefined">Contact</value>
    </values>
    <values>
        <field>ParentField__c</field>
        <value xsi:type="xsd:undefined">Opportunity__c</value>
    </values>
    <values>
        <field>ParentObject__c</field>
        <value xsi:type="xsd:undefined">Opportunity_Contact__c</value>
    </values>
</CustomMetadata>

Steps To Reproduce:

  1. Create custom metadata record with metadata relationship field
  2. Create import csv with values
  3. run command above
  4. Review custom metadata records create

Expected result

   <values>
        <field>ParentObject__c</field>
        <value xsi:type="xsd:string">Opportunity_Contact__c</value>
    </values>

Actual result

   <values>
        <field>ParentObject__c</field>
        <value xsi:type="xsd:undefined">Opportunity_Contact__c</value>
    </values>

System Information

Run sfdx version --verbose --json and paste the output here.

{
        "cliVersion": "sfdx-cli/7.110.0",
        "architecture": "darwin-x64",
        "nodeVersion": "node-v14.17.3",
        "pluginVersions": [
                "@oclif/plugin-autocomplete 0.3.0",
                "@oclif/plugin-commands 1.3.0 (core)",
                "@oclif/plugin-help 3.2.2 (core)",
                "@oclif/plugin-not-found 1.2.4 (core)",
                "@oclif/plugin-plugins 1.10.1 (core)",
                "@oclif/plugin-update 1.4.0-3 (core)",
                "@oclif/plugin-warn-if-update-available 1.7.0 (core)",
                "@oclif/plugin-which 1.0.3 (core)",
                "@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
                "@salesforce/sfdx-trust 3.6.0 (core)",
                "@venkat.polisetti/crm-sfdx-plugin 2.0.9",
                "alias 1.1.10 (core)",
                "apex 0.2.2 (core)",
                "auth 1.7.1 (core)",
                "config 1.2.13 (core)",
                "custom-metadata 1.0.12 (core)",
                "data 0.5.2 (core)",
                "dependencies-cli 2.0.1",
                "generator 1.1.8 (core)",
                "limits 1.2.1 (core)",
                "mo-dx-plugin 0.3.2",
                "org 1.6.7 (core)",
                "salesforce-alm 52.1.0 (core)",
                "schema 1.0.8 (core)",
                "sfdx-autocmplt 2.2.0",
                "sfdx-cli 7.110.0 (core)",
                "sfdx-cmdt-plugin 0.0.6 (0.0.6)",
                "sfdx-essentials 2.10.0",
                "sfdx-flowdoc-plugin 0.5.1",
                "sfpowerkit 3.1.6",
                "shane-sfdx-plugins 4.43.0",
                "├─ @mshanemc/plugin-streaming 1.1.7",
                "└─ @mshanemc/sfdx-sosl 1.1.0",
                "telemetry 1.2.2 (core)",
                "templates 52.1.0 (core)",
                "user 1.3.1 (core)"
        ],
        "osVersion": "Darwin 20.6.0"
}

The same thing happens on Github Linux workspace

Additional information

github-actions[bot] commented 3 years ago

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

RayHWLau commented 2 years ago

Same issue on: sfdx-cli/7.141.1 darwin-x64 node-v16.13.1

shetzel commented 2 years ago

This is a duplicate of https://github.com/forcedotcom/cli/issues/544 I've asked the owning team to look at the issue (internally tracked as W-8969685) once again.