You can access custom settings from formula fields, validation rules, Apex, and the SOAP API.
Only the hierarchy custom settings can be accessed from the Formula fields
Syntax: {!$Setup.CustomSettingName__c.CustomFieldName__c}.
Eg: {!$Setup.Twillo__c.AccessLogin__c}
Accessing List Custom Setting
To get the list custom setting Dataset valuesthis will be a collection of list.
From the above example the data_set_name name will be asas
Accessing Hierarchy Custom Setting
To get the hierarchy custom setting Dataset values
CustomSettingName__c mc = CustomSettingName__c.getOrgDefaults();
if you do specified any profile to the custom setting.
Then access the custom setting in the following way
CustomSettingName__c mc = CustomSettingName__c.getInstance(Profile_ID);
Use the Privacy as Public if the custom setting are to be exposed to the API.
No comments :
Post a Comment