Thursday 9 May 2013


Using List Custom Settings

The following steps describe how to build a simple custom settings object and manage the
values stored in it:
1. Go to the App Setup area and click Develop -->Custom Settings.This is where you
define custom settings and maintain their values.
2. Click the New button to define a new custom settings object. Label is the display
name for your object; Object Name is the name you’ll refer to it by in programs.
Enter Config Setting as the Label, and ConfigSetting as the Object Name. For
Setting Type, select List.Visibility controls how this setting behaves when packaged.
Leave it as Protected. Use the Description field to explain the purpose of your custom
setting to other developers in your organization.
Tip
Following a naming convention for your custom settings so that they can be easily differentiated
from custom objects is a good practice. For example, append the word “Setting” to the
end of any custom setting name. The value of naming conventions will become more apparent
when you write Apex code that interacts with the database.
3. Click the Save button.Your custom setting is now created and needs some fields
and data. Each custom setting can have up to 300 fields.
4. In the Custom Fields section, click the New button to create a new field. Custom
settings fields use a subset of the data types available to custom object fields.They
are Checkbox, Currency, Date, Date/Time, Email, Number, Percent,Text,Text
Area, and URL. Select Checkbox for your field and click the Next button. For the
field label, enter Debug.The Field Name, used to refer to the field in code, is automatically
populated. Click the Next button.
5.
You’re ready to store values in your custom settings object. Force.com provides a standard
user interface for this purpose. Click the Manage button and then the New button.There
is a field for the Name of the setting record, which serves as a human-readable identifier
for the record. Following the name are the custom fields you’ve defined on the custom
setting. In this case, you have a single checkbox field named Debug. Enter Default for
the name, select the Debug box, and click the Save button.

No comments:

Post a Comment