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?
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?
Best Answer
The getInstance() and getValues() do not always return the same object for hierarchical custom settings but for list custom settings they return the same values .
From the docs
getInstance() Returns a custom setting data set record for the current user. The fields returned in the custom setting record are merged based on the lowest level fields that are defined in the hierarchy.
getValues() Returns the custom setting data set record for the specified user ID
The above confirms that both return same for list custom settings.