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.

Metadata from Sandbox always retrieved with latest API version instead of following sourceApiVersion

See original GitHub issue

Summary

Metadata Retrieval from a Sandbox always uses the latest API version (right now, 45.0) instead of using the sourceApiVersion specified in sfdx-project.json.

Steps To Reproduce:

  1. Use an old API version in sfdx-project.json, for example:
{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "43.0"
}

  1. Authorize with a Sandbox

  2. Right click on a custom object in the objects directory, click SFDX: Retrieve Source From Org

Expected result

The retrieved custom object should have their metadata structure based on the sourceApiVersion.

Actual result

The retrieved custom object has their metadata structure based on version 45.0. One thing that is easy to check is the existence of the enableLicensing node in the metadata XML, which does not exist in version 43.0.

Additional information

VS Code Version: 1.34.0

SFDX CLI Version: sfdx-cli/7.6.0-28071a499b

OS and version: Windows 10/Arch Linux

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ChuckJonascommented, Jul 31, 2020

Just came across this issue. It’s pretty tough to deal with as the API version has a BIG impact and needs to be consistent across dev machines and CI environments.

@clairebianchi any chance this is in the backlog?

1reaction
dieffreicommented, Jul 31, 2020

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Metadata shown as modified When Pulled from Sandbox
When you make a retrieve with mdapi, all files are overwritten, and thus have their file-system's "modification time" audit field updated.
Read more >
Flow | Metadata API Developer Guide
The active flow is the latest version. After you deploy changes to an active flow, the flow's detail page displays a new flow...
Read more >
Develop Against Any Org with Visual Studio Code Tasks
Learn how to use Salesforce CLI and Salesforce Extensions for Visual Studio Code to deploy, retrieve, and delete metadata against any org.
Read more >
@salesforce/cli - npm
Latest version : 1.41.0, last published: 12 days ago. ... restDeploy Whether deployments use the Metadata REST API (true) or SOAP API (false,...
Read more >
CI and Delivery Using Salesforce Developer Experience
It simplifies integration with a version control system and helps build a better ... SFDX source format differs from Metadata API format.
Read more >

github_iconTop Related Medium Post

No results found

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