4

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 linked question appears to be about a one-time fault in source tracking, not in the ability to retrieve or deploy the metadata for Custom Settings per se. That is very much possible. Are you experiencing a problem with Custom Settings today? – David Reed Jul 24 at 17:50
5

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
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.