Tuesday, January 31, 2023

Let's settle the debate between Custom Metadata, Custom Objects and Custom Settings


This is a common scenario in any design meeting. First, you have the one person who recommends using Custom Metadata for something that clearly should be a Custom Object. But custom metadata can be deployed using the release pipeline, and it's easy. Why do we create too many custom objects? Knowing the purpose behind these features is essential to use them effectively.

Let's start with custom settings. These bad boys are like the steroids of your application, allowing you to store information such as default values, external service endpoints, or other data that needs to be accessed at warp speed. Thanks to custom settings being cached in memory, they're always ready to go when needed. Plus, they can be accessed by Apex classes, Visualforce pages, and formula fields, making them the perfect tool for storing data that needs to be accessed quickly.

Next up, custom metadata types. These are like the blueprints of your application, allowing you to control your application based on its value. Custom metadata is perfect for storing information that needs to be accessed by Apex classes, Visualforce pages, formula fields and validation rules. Still, it's meant to keep only a small amount of data. Think of it as the blueprint of your application, giving you a clear and organized structure for your data. One of the biggest arguments for this is that it can be moved as metadata during deployment in SFDX, but we have to understand that choosing a feature is not a decision made to make the life of a tech team easy but better for the system.

Finally, we have custom objects. These are the powerhouses of your application, allowing you to store data specific to your organization. They're great for storing information such as customers, products, or other data that must be kept in Salesforce. Custom objects can be accessed by Apex classes, Visualforce pages, and formula fields, and they can also be used to create custom tabs, reports, and dashboards. They're the perfect tool for storing large amounts of data and giving your application the structure and power it needs to knock the socks off of your users.

In short, custom settings are your steroids, custom metadata is your blueprint, and custom objects are your powerhouses. Understanding when to use each one will help you create better Salesforce applications. What do you think?

Share:

0 comments:

Post a Comment