How to deploy custom settings in Salesforce

How to deploy custom settings in Salesforce

Eliza Pepper on

Share with



Custom settings are a great example of ‘clicks not code’ development, allowing you to build reusable rules that will create custom data sets. But custom settings have hidden complexities that make deploying them a challenge, because Salesforce is doing a lot of heavy lifting behind your interface.

If you’re struggling to get your head around custom settings and how to deploy them, you’re not alone! Read on for our full guide to custom settings in Salesforce and how you can deploy them without headaches.

What are custom settings?

You likely have thousands of records in your Salesforce Org, each made up of multiple fields that contain business-critical data. But some of your fields will be accessed more frequently than others — like the case status or contact number fields. Custom settings allow your users to quickly access the most frequently used or high priority data, streamlining the user journey.

There are two different types of custom settings:

  • List custom settings, which you can use to create a static set of data. For example, a list of international calling codes. A list custom setting can be accessed by any profile or user across your organization, so you’ll only want to create these for data sets that are useful business-wide.
  • Hierarchy custom settings can be personalized for different profiles or users. This could allow you to create a custom setting for your marketing team to view records associated with specific campaigns, or to store a default tax rate for your sales team.

Custom settings can be useful for a variety of end-users, and can be used in Formula fields, validation rules, flows, Apex, and SOAP AI.

What are custom metadata types?

Custom settings (__cst) are often mistaken as a type of custom metadata (__mdt), but they’re actually classified as custom objects. This confusion comes from custom settings and custom metadata having some overlapping functionality for list-based data. But, there are key differences that will help determine which is the best fit for your use case:

  • Custom metadata types are fairly static, so you won’t want to use these if your customization will be frequently changing.
  • You can’t perform Data Manipulation Language (DML) commands on custom metadata types. You can do this for custom settings and other custom objects though, allowing you to easily customize these in future.
  • You can’t create an access hierarchy of data using custom metadata as you can with custom settings.

Most importantly, custom metadata type records are deployable, but it’s tricky to deploy custom setting data because this can’t be done through standard deployment methods.

Why’s it hard to deploy custom settings?

Deploying custom settings can be tricky because you’ll need to use different processes to deploy the metadata and data. You can deploy your custom setting metadata using normal migration methods, but you can’t deploy the data using packages, the Metadata API or Change Sets.

Let’s take a look at how you can deploy custom settings with Salesforce and how Gearset can help streamline that process.

How to deploy custom settings in Salesforce

When deploying custom settings in Salesforce, you’ll need to start by deploying the metadata first using your typical deployment process.

Next, deploy the data. You’ll need to manually input the records or insert them using an Apex script. This makes deploying custom settings data with Salesforce native tools a time-consuming and error-prone process.

Teams who use custom settings often need to deploy faster and more reliably than native solutions can support. Thankfully, there is an easy alternative.

How to deploy custom settings with Gearset

With Gearset, deploying both custom setting data and metadata is simple! As with native tooling, you’ll need to start by deploying the metadata, before moving on to deploy the data. Thankfully, Gearset can make this process entirely click-driven, quicker and more likely to succeed first time.

If you want to follow this walkthrough, start your free 30-day trial to see Gearset in action for yourself.

Deploying custom settings metadata

Custom setting metadata can be deployed in Gearset using the same intuitive deployment flow as any other metadata type!

To get started, you’ll need to select a source and target org and choose the relevant metadata to retrieve from the Comparison filter. You’ll want Custom object to be included in your comparison filter — but you can make changes to this later in the process, so don’t worry if you might not have selected all the metadata you need. Once your metadata is selected select Compare now.

Gearset will then run a comparison between the metadata in your selected source and target orgs and the UI will highlight changed, new and deleted items. To build your deployment package, simply select the custom settings you want to deploy.

Selecting your new custom setting to deploy

Gearset’s problem analysis will then suggest improvements and additions for your deployment package, to help ensure you successfully deploy your custom setting metadata.

Deploying custom settings data

Once you’ve successfully deployed the custom setting metadata, you can deploy your custom setting data. To get started, you’ll need to head over to the Configure and deploy data section of the Gearset app, rather than struggle with Salesforce native data loader.

Configure and deploy

Start by finding the custom setting object that you want to include in the deployment. Your custom setting object’s name will appear with the __c suffix which helps to differentiate custom objects or settings from standard Salesforce objects. In our example, we can see the object Region_Configuration_c.

Gearset gives you the option to only deploy a specific number of records and you can set up specific filtering to ensure you’re only deploying the records you’re interested in.

Configuring your custom setting data deployment

You can also choose whether or not to deploy child records of the parent records that you are already deploying.

You can choose to include related objects in the data deployment

Gearset will flag if there are any active validation rules on objects selected for your deployment. We recommend disabling any active rules because a data deployment will fail if the data being deployed doesn’t comply with the active rules. You can disable and reenable validation rules from within Gearset in just a few clicks.

You may also need to include related objects in your deployment, but don’t worry because Gearset will flag these for you and suggest that you add them. For a detailed walkthrough of using Gearset’s data loader for custom settings data, check out our documentation here.

Deploying custom settings made simple

While custom settings are a great quality of life improvement for end users and can help streamline work processes, they are often a pain to deploy. If you’re keen to see how Gearset can take the hassle out of the metadata and data deployments for custom settings, learn more about our Salesforce deployment solution and try it for yourself with your free 30-day trial.

Ready to get started with Gearset?