[SalesForce] Custom Label, Custom Setting or Custom Metadata Type for a simple URL

In one of my orgs, I have a simple Visualforce page with just an iframe inside. I don't want the URL to be hard-coded. I didn't develop anything else in this org.

To store this simple URL, which one should I use? Custom Label, Custom Setting or Custom Metadata Type?

Best Answer

I would prefer Custom Setting for your requirement. As per Salesforce guidelines below are purpose of all three

Custom settings are similar to custom objects and enable application developers to create custom sets of data, as well as create and associate custom data for an organization, profile, or specific user.All custom settings data is exposed in the application cache, which enables efficient access without the cost of repeated queries to the database. This data can then be used by formula fields, validation rules, flows, Apex, and the SOAP API.

Custom metadata is customizable, deployable, packageable, and upgradeable application metadata. It mainly used to define for custom application development.

Custom labels enable developers to create multilingual applications by automatically presenting information in a user's native language.

So ideally Custom Setting is used for data setting.

Related Topic