salesforcedx-vscode icon indicating copy to clipboard operation
salesforcedx-vscode copied to clipboard

Org Browser ignores sfdx-project.json api version

Open simonfodenslimmingworld opened this issue 3 years ago • 12 comments

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:

  1. Change a Flexipage.
  2. Download the metadata via Org Browser.
  3. 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).

simonfodenslimmingworld avatar Nov 22 '21 12:11 simonfodenslimmingworld

I was able to reproduce this bug.

jeffb-sfdc avatar Dec 07 '21 01:12 jeffb-sfdc

This issue has been linked to a new work item: W-10273533

uip-robot-zz avatar Dec 07 '21 01:12 uip-robot-zz

@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:

  1. Logged into my org and created a new Lightning Page
  2. Switch to VS Code (running with the Salesforce Extension for VS Code installed, and authenticated into my org)
  3. In the Org browser, navigated to Flexi Pages, and then clicked the "Refresh Components" button.
  4. Selected my newly-created Flexi Page, and clicked the "Retrieve and Open Source" button
  5. 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.

jeffb-sfdc avatar Jan 11 '22 20:01 jeffb-sfdc

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

simonfodenslimmingworld avatar Jan 12 '22 16:01 simonfodenslimmingworld

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!

peeriyagama avatar Feb 09 '22 05:02 peeriyagama

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.

klouf-threshold avatar Jul 21 '22 21:07 klouf-threshold

I have a similar issue with GlobalValueSets and API version 56.0

jdgirald avatar Aug 30 '22 19:08 jdgirald

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 avatar Mar 22 '23 11:03 1eandro

@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 avatar Mar 22 '23 15:03 jeffb-sfdc

@jeffb-sfdc sure!

I have the following versions:

  • vscode:

image

  • vscode extensions: -> Salesforce Extension Pack: v54.11.0

my sfdx-project.json file has the "sourceApiVersion": "52.0":

image

When I retrieve a QuickAction through the Org Browser image the <identifier> tags are retrieved

image

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

image

1eandro avatar Mar 22 '23 16:03 1eandro

Thanks for the info @1eandro . I was able to reproduce the issue and will be work on a fix for this.

jeffb-sfdc avatar Apr 10 '23 17:04 jeffb-sfdc

@1eandro I thought I'd post an update here. I have a fix and it will be going in soon.

jeffb-sfdc avatar May 24 '23 17:05 jeffb-sfdc

Closing the issue as the fix has been merged.

diyer avatar Mar 28 '24 20:03 diyer