Why I can't create relationship between custom object and custom setting. When try to create lookup field in my custom object, custom settings are not listed in available objects.

  • Because I think custom settings are not stored in the database and custom settings are similar to properties file in java world. – javanoob Dec 20 '16 at 11:54
  • no need to create relationship between Custom setting and object. As Custom setting can be queried anywhere irrespective of what object you are working on. – Ankuli Dec 20 '16 at 13:07

No, you cannot create a relationship from a Standard Object or a Custom Object to a Custom Setting (nor the other way around).

As for why, the simple answer is that it is a platform limit. They were designed with this limitation in place, and it is a constraint you have to keep in mind when selecting Custom Settings as part of your solution.

From a technical perspective, I imagine part of the reasoning was to help the cloud architecture Salesforce has put in place scale to billions of transactions per day. As you may know, Custom Settings are stored in the application cache:

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.

Injecting data dependencies to or from this layer of the application would increase the technical complexity of implementing that caching mechanism, at the very least, if not make it impossible.

| 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.