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
485 stars 78 forks source link

sf cli not retrieving custommetadata records #2652

Closed junners closed 7 months ago

junners commented 7 months ago

Note Before you submit your issue, make sure that:

  • You're using the latest version of Salesforce CLI.
  • You've searched both open and closed issues for related posts.
  • You've used the doctor command to diagnose common issues.
  • You understand that GitHub Issues don't adhere to any agreement or SLA.
    • If you require immediate assistance, use official channels such as Salesforce Customer Support.

Summary

Running sf project retrieve start -m CustomMetadata -o <org> does not retrieve any custom metadata record

Steps To Reproduce

  1. from an existing sfdx project, auth an org.
  2. manually create a custom metadata and custom metadata record
  3. run sf project retrieve start -m CustomMetadata -o <org>
  4. -- returns warning nothing is retrieved --

IMPORTANT Provide a repository that's configured to reproduce the issue. If you are unable to provide a repo, please explain why not. The more info we have from the start, the faster we can resolve your issue. We may close your issue if you don't include proper instructions.

  • Generate a project with sf project generate or fork dreamhouse-lwc.
  • Provide detailed step-by-step instructions on how to reproduce the issue.

Expected result

Metadata will be retrieved, for existing metadata- it should go to the appropriate package directory, if not existing in another package directory, it goes to the default.

Actual result

Actual Result

System Information

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.24.4",
  "nodeVersion": "node-v20.11.0",
  "osVersion": "Darwin 22.6.0",
  "rootPath": "/Users/jun.jose/.nvm/versions/node/v20.11.0/lib/node_modules/@salesforce/cli",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.0.5 (core)",
    "@oclif/plugin-commands 3.1.0 (core)",
    "@oclif/plugin-help 6.0.10 (core)",
    "@oclif/plugin-not-found 3.0.8 (core)",
    "@oclif/plugin-plugins 4.1.15 (core)",
    "@oclif/plugin-search 1.0.11 (core)",
    "@oclif/plugin-update 4.1.7 (core)",
    "@oclif/plugin-version 2.0.11 (core)",
    "@oclif/plugin-warn-if-update-available 3.0.9 (core)",
    "@oclif/plugin-which 3.0.14 (core)",
    "@salesforce/cli 2.24.4 (core)",
    "apex 3.0.17 (core)",
    "auth 3.2.0 (core)",
    "data 3.0.14 (core)",
    "deploy-retrieve 3.1.0 (core)",
    "dev 0.7.9 (user)",
    "info 3.0.15 (core)",
    "limits 3.1.2 (core)",
    "marketplace 1.0.16 (core)",
    "org 3.2.2 (core)",
    "packaging 1.22.2 (user)",
    "schema 3.1.0 (core)",
    "settings 2.0.15 (core)",
    "sobject 1.1.0 (core)",
    "source 3.1.3 (core)",
    "telemetry 3.1.9 (core)",
    "templates 56.0.9 (core)",
    "trust 3.3.1 (core)",
    "user 3.2.1 (core)",
    "@salesforce/sfdx-scanner 3.13.0 (user)",
    "plauti-sfdx 0.0.5 (user)"
  ]
}

Additional information

dev-debug-log.log

github-actions[bot] commented 7 months 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.

shetzel commented 7 months ago

I'm not able to reproduce this following your steps. After I create the custom metadata type and record, then retrieve:

sf project retrieve start -m CustomMetadata
Retrieving v59.0 metadata from test-smecxjfdvipn@example.com using the v60.0 SOAP API
Preparing retrieve request... Succeeded

Retrieved Source
==============================================================================================================================
| State   Name                      Type           Path
| ─────── ───────────────────────── ────────────── ───────────────────────────────────────────────────────────────────────────
| Created TestCMeta.TestCMetaRecord CustomMetadata force-app/main/default/customMetadata/TestCMeta.TestCMetaRecord.md-meta.xml
shetzel commented 7 months ago

I would check the .forceignore in your project to make sure there isn't an entry that would cause CustomMetadata files to be ignored. E.g., intending to ignore markdown files with an entry of */.md** or something similar could match .../TestCMeta.TestCMetaRecord.md-meta.xml

junners commented 7 months ago

Oh thats a really good catch sorry my bad. Please close this ticket

On Thu, Jan 18, 2024 at 12:48 PM Steve Hetzel @.***> wrote:

I would check the .forceignore in your project to make sure there isn't an entry that would cause CustomMetadata files to be ignored. E.g., intending to ignore markdown files with an entry of /.md* or something similar could match .../TestCMeta.TestCMetaRecord.md-meta.xml

— Reply to this email directly, view it on GitHub https://github.com/forcedotcom/cli/issues/2652#issuecomment-1899181246, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOY7M4DIZBZ7IMPE6NEER3YPGDAXAVCNFSM6AAAAABB7ZMNIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJZGE4DCMRUGY . You are receiving this because you authored the thread.Message ID: @.***>