question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Retrieve Source From Org" doesn't update originating source file

See original GitHub issue

Summary

β€œRetrieve Source From Org” doesn’t update originating source file when run from a single file outside the default directory.

It works as expected when refreshed from manifest.

Steps To Reproduce:

  1. > create project with manifest
  2. attach to some sandbox with apex code
  3. clear everything but apex classes from package.xml
  4. Right click on manifest, > retrieve source from org
  5. Create the following directory structure: force-app/other/classes
  6. Move all the files from force-app/main/default/classes to force-app/other/classes. (Optionally delete the force-app/main/default/classes folder when done)
  7. Right click on manifest, > retrieve source from org

Expected: the second time the source is retrieved (step 7), the files under force-app/other/classes will have been updated.

Result: βœ…


Retrieve Single File

  1. navigate to any .cls class under force-app/other/classes
  2. right click -> retrieve source from org

Expected: The file you ran the command against on would be refreshed. EG: force-app/other/classes/Foo.cls

Result: ❌ The retrieved code will instead be placed in the default project directory: force-app/main/default/classes

Screen Shot 2019-05-13 at 11 19 37 PM

Additional information

LOG:

=== Retrieved Source
FULL NAME               TYPE       PROJECT PATH
──────────────────────  ─────────  ───────────────────────────────────────────────────────────
ABTestingTriggerHelper  ApexClass  force-app/other/classes/ABTestingTriggerHelper.cls
ABTestingTriggerHelper  ApexClass  force-app/other/classes/ABTestingTriggerHelper.cls-meta.xml
23:12:47.72 sfdx force:source:retrieve --sourcepath /Users/jamesbond/Documents/clients/bug-repo/force-app/other/classes/ABTestingTriggerHelper.cls ended with exit code 0

VS Code Version: Version 1.33.1 (1.33.1)

SFDX CLI Version: sfdx-cli/7.5.0-e6ca93eee8 darwin-x64 node-v10.15.3

OS and version: osx 10.14.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:23 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ChuckJonascommented, Jul 29, 2020

@shetzel just rang through my reproduction steps in the original post and it friggin work as expected now!

πŸ™‡ Finally, we can start using different folder structures

2reactions
shetzelcommented, Jul 22, 2020

@ChuckJonas - great question/callout! Sorry, I wasn’t clear in my post. As part of the mpd support for source:deploy and source:retrieve (and push/pull for that matter) the file mapping was changed so that this usecase should now be supported whether multiple package directories are used or not. You’re absolutely right that this usecase isn’t about mpd but about proper file mapping.

If the canary release doesn’t fix this usecase please mention me and I’ll make sure it does. This should definitely work and I’m sorry it’s taken this long to get it fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode SFDX: Retrieve Source from Org failing
I created a new project with the command: SFDX: Create Project with Manifest . Then right-click on the package.xml file in the manifestΒ ......
Read more >
source Commands | Salesforce CLI Command Reference
Retrieve source from an org . List local changes and/or changes in a scratch org.
Read more >
SFDX: Retrieve Source from Org failed to run Salesforce
If you are trying to retrieve source from salesforce org but keep getting the error-SFDX: Retrieve Source from Org failed to run. follow...
Read more >
"SFDX: Deploy Source to Org" function missing - Stack Overflow
Try with sfdx force:source:push . If you need single file there's still source-ish deploy command (will warn you if you're overwriting somethingΒ ...
Read more >
Managing Import Profiles - Ex Libris Knowledge Center
If you choose to create MARC 21 XML files (for your source), ... was loaded with a different originating system will not change...
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found