Are GetInstance and GetValues methods of custom setting same? According to the documentation here http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_custom_settings.htm both seem to be same. What you guys think?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
You are right both return same Object. I personally prefer the
The above confirms that both return same .
As the first comment on the question points out, getInstance() and getValues() do not always return the same object for hierarchical custom settings (although they do for list custom settings). The Rich Unger article linked there explains the difference well, but in brief: