Ranjith Krishnan: Session 7
Ranjith Krishnan: Session 7
SESSION 7
Object Fields:
1. Fields are nothing but the columns in the regular database.
2. There are two types of fields.
a. Standard Fields
b. Custom Fields
3. Standard Fields:
a. There are the fields created by salesforce.
b. These fields cannot be deleted.
c. We can customize the fields
d. Some of the standard fields are called System fields.
4. System Fields:
a. There are the fields which are created by salesforce and updated by salesforce .
b. There are 7 System Fields
1. ID :
a. Salesforce by default creates 18 Character unique Id for every record.
b..Salesforce will recognize the record by using this Id
c. First Three characters of Id will represent object (Entity Id).
d. It is case-sensitive.
e. This can also be referred with 15 Digit Id. The conversion from 15 to 18 digit will be handled by
the system itself.
2. isDeleted :
a. Whenever we delete any record, value of isDeleted field is set as True.
b. When we delete any record it will still be in the object for 15 days.
c. After 15 days of time, the records would be permanently deleted.
3. CreatedById
a. This filed will store the 18 character Id of the user who created this record.
4. LastModifiedById
a. This field will store the 18 character Id of the user who last modified this record
5. CreatedDate :
a. This field will store date and time when the record was created.
6. LastModifiedDate :
a. This field will store date and time when a user was last modified manually.
7. SystemModStamp
a. This field will store date and time when the record was last modified this record
programmatically.
2. TextArea:
Format : AlphaNumeric
MaxLength : 255 Characters
Single|Multiple : Multiple Line (more than one line
3. TextArea(Long) :
Format : AlphaNumeric
MaxLength : 1,31,072 Characters
Default : 32,768 characters
Minimum Length : 256 Characters
Single|Multiple : Multiple (>= 2 or <= 50)
4. TextArea(Rich) :
Format : Formatted Data
Max Length : 1,31,072 characters
Default Length : 32,768 Characters
Minimum Lines : 10 Lines
5: Phone :
This data type is used to store the phone numbers. The data will be formatted
6. CheckBox :
This data types will store the value of true or false
Screen shot from Opportunity Page layout (Private is check box field)
7. Currency :
Currency values are stored in this field.
Max Length : (Length of Integer +Length of Decimal) should be at max 18 characters
Example : $32000.20 (5 + 2 = 7 )
(Length of this value is calculated as 5 digits before decimal +
digits after the decimal 2= 7)
Ranjith Krishnan
[email protected]
2
Ranjith Krishnan
8.Date :
Allows users to enter a date or pick a date from a popup calendar.
For Example:
9.DateTime :
Allows users to enter a date or pick a date from a popup calendar and enter a time of day.
Example:
10. Number :
These fields are used to store numerical values
Max Length : 18 characters (Length of Integer + Length of Decimal)
11. Percent :
These fields are used to store the percentage value by default '%' symbol
is appended to the data .
Max Length : 18 characters (Length of Integer + Length of Decimal)
Example:
12. Email :
This field will store the email id.
Note : Salesforce has defined validation rules to check the format of the email address.
13. PickList :
a. It is a dropdown list from which we can select one option at a time.
b. Maximum we can provide 1000 options.
c. Length of each option can be 255 characters
d. We can sort options in the ascending order.
e. We can make the first option as default option by enabling the checkbox.
f. We can add /remove/edit /reorder the options based on business requirement.
Ranjith Krishnan
[email protected]
3
Ranjith Krishnan
Example: User can pick one value from the list of options as drop down.
15 .Text Encrypted:
a. It is used to store sensitive data with masked characters.
b. Maximum length of the field is 175 characters.
c. By default no one can access the data in the original format.
d. Users with permission ‘View encrypted data’ in profile can only see this data.
e. Text encrypted fields cannot be used in formulas
f. Encrypted fields cannot be used in search Criteria or filter Conditions.
g. Encrypted fields can be used in validations, search results, report results.
16. Auto-Number
a. Automatically assigns a unique number to each record.
b. The maximum length of any auto-number field is 30 characters,
c. 20 of which are reserved for prefix or suffix text.
Example:
E-{00000}{YYYY}{MM}-{0} -> 201704-1
Ranjith Krishnan
[email protected]
4
Ranjith Krishnan
b. Standard Navigation
1. Classic
Setup
|--->Build
|---> Create
|---> Object
|--->Object Name
|---> Custom Fields and Relations
|---> New
2. Lightning
Setup
|---> Platform Tools
|---> Objects and Fields
|---> Object Manager
|---> Object Name
|--->Fields and Relation
b. Schema Builder
1. Classic
Setup
|--->Build
|--->Lightning Bolt
|--->Schema Builder
2. Lightning
Setup
|--->Platform Tools
|--->Objects and Fields
|--->Schema Builder
Ranjith Krishnan
[email protected]
5
Ranjith Krishnan
c. Force.com Quick Access Menu
Step 1: Click on the Tab of the object
Step 2: Select Force.com Menu
Step 3: Choose view fields
Step 4: Select Custom Fields and Relations
Step 5: Select new and create the fields.
7. Field Dependency:
1. If need to control the values of one field by using another field then we use field dependency.
2. Controlling Field:
a. We can choose the any of PickList Field and Checkbox field as controlling field.
b. If we choose any picklist field as controlling field, then picklist field can have only 300 options in it.
3. Dependent Field : We can choose PicklIst /MultiSelect PickList field as Dependent field.
4. We can create multilevel dependency.
5. Steps to create field dependency
Setup
|---Build
|---Object Name
|----Custom Fields and Relations
|---Field Dependency
|---Create
|---Object
|---New
Step 1: Select the Controlling Field
Step 2: Choose the Dependent field
Step 3: Include and Exclude the dependent options for the Controlling Field.
Step 4: Save .
Ranjith Krishnan
[email protected]
6