Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to save a value in a Salesforce Instance which should be universally accessible (In VisualForce Pages, Apex Classes). An example would be to save the account ID to link all contacts (from the apex code), username/password combination and so on. Out of the three methods listed below which one is the best?

  1. Static Resourcce
  2. Static Class
  3. Custom object with a single record (Get the value be querying the field)
share|improve this question

None of them.

A custom setting is what you are looking for. They are available to Apex code, Visualforce, and Formulas. Take a look at the docs and examples

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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