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
- Property ‘enableLicensing’ not valid in version 44.0
- Metadata Deploy and Push fails on Flexipage componentInstances in API 49 (Summer 20)
I don’t know the org version right now but I am using version
48.0
in mypackage.xml
for deploying all my components and have never got a version49.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
Answer
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).
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
Attribution
Source : Link , Question Author : Syed Ahmed Jamil , Answer Author : Kris Goncalves