salesforcedx-vscode
salesforcedx-vscode copied to clipboard
Org Browser ignores sfdx-project.json api version
Summary
Downloading metadata using the Org Browser ignores the sfdx-project.json API version. Right click SFDX: Retrieve Source from Org uses the correct API version specified in the sfdx-project.json file. Adding flexipages to a git repository and using DevOps to deploy resulted in metadata errors Property 'identifier' not valid in version 52.0
Right click SFDX: Retrieve Source from Org brought a different API version and metadata format for Flexipages.
Steps To Reproduce:
- Change a Flexipage.
- Download the metadata via Org Browser.
- Deploy.
Expected result
API version specified in the sfdx-project.json file should be used by the Org Browser to download the metadata.
Actual result
Previous API version used used to download metadata resulting in metadata with an older format.
Additional information
Salesforce Extension Version in VS Code: Org Browser. SFDX CLI Version: sfdx-cli/7.126.0 win32-x64 node-v16.13.0
OS and version: Windows 10 (64 bit).
I was able to reproduce this bug.
This issue has been linked to a new work item: W-10273533
@simonfodenslimmingworld I discussed this issue with my team, and this appears to be working correctly. To investigate, I performed two tests:
First Test With sourceApiVersion set to "52.0" in sfdx-project.json, I selected a flexipage and ran "SFDX: Deploy Source to Org", and I got the same error you reported.
I then changed sourceApiVersion to "53.0", ran "SFDX: Deploy Source to Org", and was able to successfully deploy. I discussed this with my team, and the consensus is that there is some markup that requires API 53.0, and the API version needs to be changed to 53.
Second Test I was concerned that the end-to-end workflow was broken, so I performed the following:
- Logged into my org and created a new Lightning Page
- Switch to VS Code (running with the Salesforce Extension for VS Code installed, and authenticated into my org)
- In the Org browser, navigated to Flexi Pages, and then clicked the "Refresh Components" button.
- Selected my newly-created Flexi Page, and clicked the "Retrieve and Open Source" button
- Switched to the Explorer view, selected my new Flexi Page, made a small change, right-clicked, and then selected "SFDX: Deploy Source to Org", and it deployed successfully. This was with the API version et to 52.0.
If you are seeing something different, or if I misunderstood the issue, please let me know.
Hello,
Thanks for looking into this.
I'm not in a position to test or replicate this now.
However I think there is an issue.
Your testing appears to be the workaround but the issue is still there.
If you're using the Org browser (via the Cloud tab in VS Code) to Read Source from Org (via refresh and download icon buttons) I don't think it respects, reads or takes into account the API version set in the sfdx-project.json file. If the API version is set to 52.00 it should read that version. If it's set to 53.00 it should read that version. I found this as the structure of the flexipage metadata changed over a release.
Right clicking in the project (not Org browser) and executing SFDX: Retrieve Source from Org does respect the API version. I think this should be uniform across the different methods and the Org browser should also respect the API version set in the sfdx-project.json file.
Regards Simon
Any solution for this one? I'm getting this exact error when I'm trying to deploy Flexipage. When I deploy the package.xml it's an unknown error. But when I right click on flexipage and deploy this error pops in vscode. Thanks!
Chiming in to say this is still an issue. If I use the Org Browser to retrieve a new Flow (v55.0) that uses a Formula as Entry Criteria, the Flow is retrieved without the filter formula and therefore fails to deploy. I've noticed it a couple times elsewhere, although I can't recall specifically at this time (could have been the same example). sfdx-project.json API version is set to 55.0 and as simonfodenslimmingworld said, using the Retrieve command elsewhere in VSCode behaves as expected and retrieves the metadata including the filter formula (and presumably the CLI does as well, but I didn't test that). I am not sure which API version the Org Browser is using (I'm assuming there must be some default value hard-coded somewhere), just that it's a version before 55.0 as that is when the Flow Formula as Entry Critieria functionality was introduced.
I have a similar issue with GlobalValueSets and API version 56.0
I experience the same problem (i.e. Org Browser not respecting the sourceApiVersion
of sfdx-project.json
) when retrieving a Flexipage.
It works though when retrieving through right-clicking in the Explorer View
@1eandro I'm on support rotation next week and will revisit this. In the mean time, since I had previously reported that I wasn't able to reproduce the issue, could you provide detailed steps you are performing to reproduce this?
@jeffb-sfdc sure!
I have the following versions:
- vscode:
- vscode extensions: -> Salesforce Extension Pack: v54.11.0
my sfdx-project.json file has the "sourceApiVersion": "52.0"
:
When I retrieve a QuickAction through the Org Browser
the
<identifier>
tags are retrieved
This should not happen, given that these tags came in on version 53.0
On the other hand, if I retrieve the file through the Explorer View the <identifier>
tags are not retrieved, as expected by the v52.0
of the api
Thanks for the info @1eandro . I was able to reproduce the issue and will be work on a fix for this.
@1eandro I thought I'd post an update here. I have a fix and it will be going in soon.
Closing the issue as the fix has been merged.