cli icon indicating copy to clipboard operation
cli copied to clipboard

sf project generate manifest produce package.xml file which does not include namespace for the custom metadata record

Open wmigas opened this issue 8 months ago • 3 comments

Summary

sf project generate manifest produce package.xml file which does not include namespace for the custom metadata record There are 2 packages installed:

  • one is unlocked with prefix XXX
  • once is managed with prefix YYY Manage package contains custom metadata ZZZ and some basic custom metadata records When generating manifest including managed and unlocked packages, there is missing name space prefix fo custom metadata entry

Steps To Reproduce

  1. create salesforce org (sandbox, trial or developer does not matter)
  2. install managed or unlocked package containing custom metadata records
  3. generate manifest using command sfdx project generate manifest --from-org org_alias --name="backup.xml" --output-dir "backup\%1" -c unlocked -c managed

Expected result

generated backup XML file should contain custom metadata records with namespace prefix XXX__FieldSetField - custom metadata XXX__FieldSetField.XXX__RecordName - custom metadata record from managed package XXX__FieldSetField.YYY__RecordName2 - custom metadata records from unlock package which depends on managed package

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>XXX__FieldSetField.XXX__RecordName</members>
        <members>XXX__FieldSetField.YYY__RecordName2</members>
        <name>CustomMetadata</name>
    </types>
    <version>55.0</version>
</Package>

Actual result

generate backup.xml file does not contain namespace prefix for custom metadata records. See missing XXX__ and YYY__ before RecordName and RecordName2 It looks like RecordName and RecordName2 are custom metadata records created in unmanaged package or with deploy without any namespace, which is not true, because later when I try to retrieve metadata I get warning that there custom metadata records do not exist.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>XXX__FieldSetField.RecordName</members>
        <members>XXX__FieldSetField.RecordName2</members>
        <name>CustomMetadata</name>
    </types>
    <version>55.0</version>
</Package>

Additional information

it works correctly in @salesforce/[email protected] it does not work in any newer version up to @salesforce/[email protected]

System Information

I'm using windows CMD or ubuntu BASH it does not work for

{
  "architecture": "win32-x64",
  "cliVersion": "@salesforce/cli/2.84.6",
  "nodeVersion": "node-v20.19.0",
  "osVersion": "Windows_NT 10.0.26100",
  "rootPath": "C:\\Users\\Wojtek\\AppData\\Local\\nvm\\v20.19.0\\node_modules\\@salesforce\\cli",
  "shell": "cmd.exe",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.27 (core)",
    "@oclif/plugin-commands 4.1.22 (core)",
    "@oclif/plugin-help 6.2.27 (core)",
    "@oclif/plugin-not-found 3.2.49 (core)",
    "@oclif/plugin-plugins 5.4.36 (core)",
    "@oclif/plugin-search 1.2.23 (core)",
    "@oclif/plugin-update 4.6.36 (core)",
    "@oclif/plugin-version 2.2.27 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.38 (core)",
    "@oclif/plugin-which 3.2.34 (core)",
    "@salesforce/cli 2.84.6 (core)",
    "apex 3.6.12 (core)",
    "api 1.3.3 (core)",
    "auth 3.6.109 (core)",
    "data 4.0.25 (core)",
    "deploy-retrieve 3.21.3 (core)",
    "info 3.4.51 (core)",
    "limits 3.3.51 (core)",
    "marketplace 1.3.8 (core)",
    "org 5.6.0 (core)",
    "packaging 2.12.3 (core)",
    "schema 3.3.58 (core)",
    "settings 2.4.22 (core)",
    "sobject 1.4.53 (core)",
    "telemetry 3.6.38 (core)",
    "templates 56.3.43 (core)",
    "trust 3.7.79 (core)",
    "user 3.6.16 (core)"
  ]
}

it works OK for

{
  "architecture": "win32-x64",
  "cliVersion": "@salesforce/cli/2.76.3",
  "nodeVersion": "node-v20.19.0",
  "osVersion": "Windows_NT 10.0.26100",
  "rootPath": "C:\\Users\\Wojtek\\AppData\\Local\\nvm\\v20.19.0\\node_modules\\@salesforce\\cli",
  "shell": "cmd.exe",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.18 (core)",
    "@oclif/plugin-commands 4.1.19 (core)",
    "@oclif/plugin-help 6.2.23 (core)",
    "@oclif/plugin-not-found 3.2.39 (core)",
    "@oclif/plugin-plugins 5.4.29 (core)",
    "@oclif/plugin-search 1.2.19 (core)",
    "@oclif/plugin-update 4.6.27 (core)",
    "@oclif/plugin-version 2.2.23 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.31 (core)",
    "@oclif/plugin-which 3.2.26 (core)",
    "@salesforce/cli 2.76.3 (core)",
    "apex 3.6.8 (core)",
    "api 1.3.3 (core)",
    "auth 3.6.91 (core)",
    "data 4.0.7 (core)",
    "deploy-retrieve 3.18.0 (core)",
    "info 3.4.34 (core)",
    "limits 3.3.44 (core)",
    "marketplace 1.3.7 (core)",
    "org 5.2.25 (core)",
    "packaging 2.9.15 (core)",
    "schema 3.3.46 (core)",
    "settings 2.4.10 (core)",
    "sobject 1.4.49 (core)",
    "telemetry 3.6.32 (core)",
    "templates 56.3.35 (core)",
    "trust 3.7.60 (core)",
    "user 3.6.6 (core)"
  ]
}

wmigas avatar Apr 16 '25 10:04 wmigas

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.

github-actions[bot] avatar Apr 16 '25 10:04 github-actions[bot]

hi @wmigas -

we've got a few other issues around supporting namespaces in the CLI https://github.com/forcedotcom/cli/issues/3052 https://github.com/forcedotcom/cli/issues/3215

we'll try to prioritize all of these soon in a fix that fixes everyone

WillieRuemmele avatar Apr 16 '25 14:04 WillieRuemmele

Associated work item: W-18220202

shetzel avatar Apr 23 '25 15:04 shetzel