Salesforce Asked by trebleCode on January 2, 2022
I’ve not found conclusive answers around DX and deploying/retrieving custom settings in a sandbox or production org.
I did see this: DX Orgs and Custom Settings
But that post is over a year old at this point. Haven’t seen anything in the DX release notes about custom settings.
Is this still not possible to deploy or retrieve via the CLI? Is this technically possible otherwise via SOAP? If anyone can share a developer doc illustrating possibilities it would be sincerely appreciated.
TIA!
The custom settings metadata can be retrieved or deployed just like any other metadata.
All you need is name of the custom setting
If you are working in orgs that cannot have source tracking enabled
sfdx force:source:retrieve -m CustomObject:<Customsettingname__c>
If you are using source tracked orgs use
sfdx force:source:pull
If you want data within these custom settings then you can use soql
sfdx force:data:soql:query -q "SELECT Id, Name FROM Customsettingname__c"
You can export the data to the local folder using
sfdx force:data:tree:export -q "SELECT Id, Name FROM Customsettingname__c" -x export-customsetting -d /tmp/sfdx-out -p
And then load the exported custom setting data into a target scratch org with
sfdx force:data:tree:import -p /tmp/sfdx-out/export-customsetting.json
Answered by Mohith Shrivastava on January 2, 2022
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP