4

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)
6

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

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_custom_settings.htm

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.