Newer Version Available

This content describes an older version of this product. View Latest

List Custom Setting Methods

The following are instance methods for list custom settings.

getAll()

Returns a map of the data sets defined for the custom setting.

Signature

public Map<String, CustomSetting__c> getAll()

Return Value

Type: Map<String, CustomSetting__c>

Usage

If no data set is defined, this method returns an empty map.

For Apex saved using Salesforce.comAPI version 20.0 or earlier, the data set names, which are the keys in the returned map, are converted to lower case. For Apex saved using Salesforce.comAPI version 21.0 and later, the case of the data set names in the returned map keys is not changed and the original case is preserved.

Note

getInstance(String)

Returns the custom setting data set record for the specified data set name. This method returns the exact same object as getValues(dataset_name).

Signature

public CustomSetting__c getInstance(String dataset_name)

Parameters

dataset_name
Type: String

Return Value

Type: CustomSetting__c

Usage

If no data is defined for the specified data set, this method returns null.

getValues(String)

Returns the custom setting data set record for the specified data set name. This method returns the exact same object as getInstance(dataset_name).

Signature

public CustomSetting__c getValues(String dataset_name)

Parameters

dataset_name
Type: String

Return Value

Type: CustomSetting__c

Usage

If no data is defined for the specified data set, this method returns null.