cli icon indicating copy to clipboard operation
cli copied to clipboard

Not being able to retrieve new metadata

Open jakobpack opened this issue 3 years ago • 2 comments

Summary

Creating new metadata, a custom field for example, does not get retrieved. Results show "No results found". When I create the metadata by hand locally and then retrieve, it retrieves the field successfully. Is there a new setting? Me and my colleague are experiencing the same with ExperienceBundle.

Steps To Reproduce:

  1. Create new custom field.
  2. Try to retrieve by sfdx force:source:retrieve -m CustomField:Object.Field__c.

Expected result

Retrieves the new field.

Actual result

Doesn't find any results.

System Information

  • I am using zsh.
{
  "cliVersion": "sfdx-cli/7.163.0",
  "architecture": "darwin-x64",
  "nodeVersion": "node-v16.16.0",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 1.3.0 (core)",
    "@oclif/plugin-commands 2.2.0 (core)",
    "@oclif/plugin-help 5.1.12 (core)",
    "@oclif/plugin-not-found 2.3.1 (core)",
    "@oclif/plugin-plugins 2.1.0 (core)",
    "@oclif/plugin-update 3.0.0 (core)",
    "@oclif/plugin-version 1.1.1 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.4 (core)",
    "@oclif/plugin-which 2.1.0 (core)",
    "alias 2.1.0 (core)",
    "apex 1.1.0 (core)",
    "auth 2.2.3 (core)",
    "community 2.0.0 (core)",
    "config 1.4.17 (core)",
    "custom-metadata 2.0.0 (core)",
    "data 2.1.1 (core)",
    "generator 2.0.2 (core)",
    "info 2.0.1 (core)",
    "limits 2.0.1 (core)",
    "org 2.0.7 (core)",
    "schema 2.1.1 (core)",
    "signups 1.2.0 (core)",
    "source 2.0.11 (core)",
    "telemetry 2.0.0 (core)",
    "templates 55.1.0 (core)",
    "trust 2.0.3 (core)",
    "user 2.1.0 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.0.0 (core)",
    "salesforce-alm 54.7.1 (core)",
    "sfdmu 4.15.1 (user)",
    "sfpowerkit 4.2.13 (user)"
  ],
  "osVersion": "Darwin 21.6.0"
}

jakobpack avatar Aug 15 '22 11:08 jakobpack

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 Aug 15 '22 11:08 github-actions[bot]

@jakobpack I'm unable to reproduce this with both latest (7.163.0) or latest-rc (7.164.1)

Are you able to provide steps to reproduce the issue? Thanks!

mdonnalley avatar Aug 15 '22 15:08 mdonnalley

I found the problem. It occurs when multiple path objects are present in the packageDirectories array in sfdx-project.json. Reducing them to only one path, fixes the problem.

jakobpack avatar Aug 23 '22 13:08 jakobpack

@jakobpack Thanks for the update. I just tried to replicate it with the following

  • clone https://github.com/salesforcecli/sample-project-multiple-packages (this project already has multiple entries in packageDirectories
  • cd sample-project-multiple-pacakges
  • sfdx force:org:create -f config/project-scratch-def.json -s
  • sfdx force:org:open
  • Create new CustomField on Account
  • sfdx force:source:retrieve -m CustomField:Account.Test__c

Which was successful:

~/repos/salesforcecli/sample-project-multiple-packages (main*) » sfdx force:source:retrieve -m CustomField:Account.Test__c
Preparing retrieve request... done
=== Retrieved Source

 FULL NAME       TYPE        PROJECT PATH
 ─────────────── ─────────── ────────────────────────────────────────────────────────────────────
 Account.Test__c CustomField force-app/main/default/objects/Account/fields/Test__c.field-meta.xml

Are you able to share a repo that replicates it? Thanks!

mdonnalley avatar Aug 23 '22 20:08 mdonnalley

Closing due to inactivity. If you are able to provide reproduction steps, please feel free to re-open this issue 🙇 Thanks!

iowillhoit avatar Aug 31 '22 21:08 iowillhoit