Wednesday, March 5, 2014

Salesforce Custom Settings

Salesforce Custom Settings


Although Custom Setting is similar with Custom Object, but they are different and for totally different usage. Custom object used to store all data within Salesforce for any transactions, it works similar with standard object, such as: Account, Contact, Opportunity, etc and you can create custom tab for that object.

While custom setting used to store application configurations, such as: value based on each application type or user. You cannot put custom setting data into Salesforce page layout directly as custom object. But, to access custom setting data, you need to access it from: Formula fields, Validation rules, Workflow rules, Apex class, and SOAP API.

There are 2 type of custom setting: List and Hierarchy. Formula field, Validation rule and Workflow only can access Hierarchy type custom setting, while Apex and SOAP API can access both.

Sample to access hierarchy custom setting from formula field or validation rule:
{!$Setup.CustomSettingName__c.CustomFieldName__c}

From SOAP API:
Select p.Description__c, p.Id, p.Name, p.Sign_Date__c from Position__c p
this is very similar with SOQL query to custom object.


Limitation of Custom Setting:

  • Maximum total data of 10 MB, but if you have less than 10 license users, multiply 1 MB with number of users
  • 300 fields per custom setting.
  • Can’t share a custom setting record.
  • No owner assigned for each custom setting record
  • Each custom setting counts against the total number of custom objects available for your organization.


For more information, see think Salesforce documentation.

0 comments:

Post a Comment

 
| ,