-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sf cmdt generate records: Underscore replacement for filename only happens once #2158
Comments
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. |
This issue has been linked to a new work item: W-13482203 |
Thank you @chris-duncan-adaptiva for the excellent repo to reproduce the problem ❤ I've got a fix coming here soon! |
Alright, has been merged and will be available in tomorrow's |
this was fixed in sf v1.81.0. |
Summary
The command
sf cmdt generate records
will create custom metadata records from a CSV, and part of that process is indicating a column used for the MasterLabel field which is also translated to the DeveloperName field via the generated filename. However, while underscores should replace every non-alphanumeric character into underscores, and leading digits prefixed with an X, only the first space is replaced with an underscore, and other characters are ignored.Steps To Reproduce:
Repository to reproduce: dreamhouse-lwc-2158
NOTE: If your issue is not reproducable by dreamhouse-lwc, i.e. requires specific metadata or files, we require a link to a simple Salesforce project repository with a script to setup a scratch org that reproduces your problem.
https://github.com/chris-duncan-adaptiva/dreamhouse-lwc-2158/blob/main/bin/install-scratch.sh
sf cmdt generate records --csv <CSV_PATH_HERE> --type-name <MDT_HERE> --name-column MasterLabel
replacing arguments in brackets <> as appropriate.Expected result
Filename is transformed as if entered via the Setup UI, which leading digits prefixed by the letter 'X' and non-alphanumeric characters replaced with underscores. (From our example above it should become Test.X7test_this_cmdt_bug.md-meta.xml).
Actual result
Filename is only transformed to substitute the first space in the label with an underscore. Leading digits are not prefixed with 'X' and non-alphanumeric characters after the first space are left unchanged.
System Information
Which shell/terminal are you using? (e.g. bash, zsh, powershell 5, powershell 7, cmd.exe, etc.)
bash
If you are using
sfdx
sfdx version --verbose --json
If you are using
sf
sf version --verbose --json
{
"cliVersion": "@salesforce/cli/1.78.6",
"architecture": "win32-x64",
"nodeVersion": "node-v18.14.2",
"osVersion": "Windows_NT 10.0.22621",
"shell": "cmd.exe",
"rootPath": "C:\Users\ChrisDuncan\AppData\Roaming\nvm\v18.14.2\node_modules\@salesforce\cli",
"pluginVersions": [
"@oclif/plugin-autocomplete 2.2.0 (core)",
"@oclif/plugin-commands 2.2.15 (core)",
"@oclif/plugin-help 5.2.9 (core)",
"@oclif/plugin-not-found 2.3.23 (core)",
"@oclif/plugin-plugins 3.0.1 (core)",
"@oclif/plugin-search 0.0.17 (core)",
"@oclif/plugin-update 3.1.14 (core)",
"@oclif/plugin-version 1.3.4 (core)",
"@oclif/plugin-warn-if-update-available 2.0.36 (core)",
"@oclif/plugin-which 2.2.20 (core)",
"@salesforce/cli 1.78.6 (core)",
"apex 2.2.17 (core)",
"auth 2.7.15 (core)",
"custom-metadata 2.1.20 (user)",
"data 2.3.16 (core)",
"deploy-retrieve 1.8.20 (core)",
"env 2.1.6 (user)",
"functions 1.21.7 (user)",
"info 2.6.10 (core)",
"limits 2.3.14 (core)",
"login 1.2.8 (core)",
"org 2.8.2 (core)",
"packaging 1.15.0 (user)",
"schema 2.3.10 (core)",
"settings 1.4.6 (core)",
"signups 1.4.6 (user)",
"sobject 0.1.18 (core)",
"source 2.10.7 (core)",
"telemetry 2.2.0 (core)",
"templates 55.4.13 (core)",
"trust 2.4.16 (core)",
"user 2.3.10 (core)"
]
}
Additional information
Feel free to attach a screenshot.
The text was updated successfully, but these errors were encountered: