14

I am trying to deploy a flexipage to a newly created sandbox org and I am getting the following error

Property 'componentInstances' not valid in version 49.0

I have read the following links but still have questions

I don't know the org version right now but I am using version 48.0 in my package.xml for deploying all my components and have never got a version 49.0 error.

My question is that even if I assume the new sandbox org is version 49.0. But why is it giving this error when I am using version 48.0 specifically in my package.xml ?

What is the use of mentioning version number in package.xml then if it still looks at the org version ?

Thanks

7
  • 1
    What deployment tool are you using? That may have some effect on what's happening.
    – sfdcfox
    Commented Aug 19, 2020 at 16:36
  • 1
    what's the sourceApiVersion on the sfdx-project.json file assuming you're using VS Code (tagged as salesforcedx)? Commented Aug 19, 2020 at 16:36
  • @sfdcfox Well for now I am using sfdx cli. Commented Aug 19, 2020 at 17:13
  • @KrisGoncalves I just checked the sourceApiVersion is 49.0 Commented Aug 19, 2020 at 17:14
  • @KrisGoncalves Does it mean the org is version 49.0 and I can't use version 48.0 ? Commented Aug 19, 2020 at 17:15

3 Answers 3

18

The sourceApiVersion on the sfdx-project.json is what controls what API certain CLI commands use. You can change this to 48.0 and deploy if you'd like (even to an Org on 49.0 that may have changed the underlying metadata).

enter image description here

I was able to deploy a FlexiPage with componentInstances references to an org with 49.0 by setting the sfdx-project.json file's sourceApiVersion to 48.0.

sfdx force:source:deploy -m FlexiPage:name_of_flexipage

I recommend pulling in the changes with API 49.0 after a successful deploy, however, to retrieve the metadata of the FlexiPage on API 49 to get the latest format and using that going forward.

sfdx force:source:retrieve -m FlexiPage:name_of_flexipage

You'll notice that componentInstances will be removed and replaced with itemInstances and componentInstance

3
  • Thanks. It got deployed after changing sourceApiVersion to 48.0 in sfdx-project.json file. Will you clear me on one thing though, is there any thing such as the ORG's api version ? Or the api version is related to each individual components and its releases. In other words can we set an ORG's api version ? If so then does it mean that by default components will be deployed based on ORG's api version unless specified which version to use in sfdx-project.json file. Is my thinking correct ? Commented Aug 20, 2020 at 12:38
  • 1
    Yes. The Org's API version is out of your control, but you can interact with the Metadata API (to retrieve/deploy components in your org) at different versions and it'll return/deploy /function as it was in that version regardless if your current Org's version is ahead. This allows you to use properties that are only in previous API versions even when future versions changes it. Likewise, you'll see when you pull it (as 49) that it'll be in the new format with the changed properties automatically even though you deployed as 48 with a different property. Commented Aug 20, 2020 at 13:01
  • That makes sense. Commented Aug 21, 2020 at 12:42
5

This is a change with the v49.0 summer 21 release. Meaning you won't be able to use v48.0 version of the metadata in the v49.0 org unless you push with v48.0 in sfdx-project.

Once all the orgs are updated to v49.0, make sure to retrieve using the v49.0 in the sfdx-project.json and deploy to update the metadata.

1
  • 1
    I'll keep that mind. But for now I am not to shift to version 49.0 and make changes in the Flexipages at the moment. Maybe after all orgs shift to version 49.0 I might have to do it as you said. Commented Aug 20, 2020 at 12:41
-2

Open Sfdx-Project file and update sourceApiVersion to latest

Open Sfdx-Project file and update sourceApiVersion to latest as shown in screenshot.

1
  • 2
    Frankly, this doesn't add anything useful to the answers already posted - does it? Commented May 15, 2022 at 9:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .