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?
Tell me more
×
Salesforce Stack Exchange is a question and answer site for
Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.
|
You are right both return same Object.I personally prefer the getInstance() method as it makes more sense to me. You access a record by using the value in the Name column (you cannot use the ID or other columns).
The following confirms that both return same . |
|||
|
|

Rich's Rule of Thumb When Working With Custom Settings: Use getValues() when you’re writing custom settings, and use getInstance() when reading them.– user320 Feb 24 at 20:56