Data types in Apex Programming
Data types in Apex programming:-
1. Auto Number: 
A system-generated sequence number that uses a display format you define. The number is automatically incremented for each record.
2. Formula: 
A read-only field that derives its value from a formula expression you define. The formula field is updated when any of the source fields change.
3. Roll-Up Summary:
 A read-only field that displays the sum, minimum or maximum value of a related list.   
4. Lookup Relationship: 
Create a relationship that links this object to another object. The relationship allows users to click on a lookup icon to select a value from a popup list.
5. Master-Detail Relationship:
 Create a special type of parent-child relationship between this object(the child or "detail") and another object(the parent or "master").
6. External Lookup Relationship: 
Create a relationship that links this object to an external object whose data is stored outside the Salesforce Org.
7. Checkbox: 
Allows users to select a True(checked) or False(unchecked) value.
8. Currency: 
Allows users to enter a dollar or other currency amount and automatically formats the field as a currency amount.
9. Date: 
Allows users to enter a date or pick a date from a popup calendar.
10. Date/Time: 
Allows users to enter a date and time, or pick a date from a popup calendar.
11. Email: 
Allows users to enter an email address, which is validated to ensure proper format. If this field is specified for a contact or lead, users can choose the address when clicking Send an Email.
12. Geolocation: 
Allows users to define locations. Includes latitude and longitude components, and can be used to calculate distance.
13. Number:
 Allows users to enter any number. Leading zeros are removed.
14. Percent: 
Allows to user to enter a percentage number.
15. Phone: 
Allows users to enter any phone number. Automatically formats it as a phone number.
16. Picklist: 
Allows users to select a value from a list you define.
17. Picklist(Multi-Select): 
Allows users to select multiple values from a list you define.
18. Text: 
Allows users to enter any combination of letters and numbers.
19. Text Area:
 Allows users to enter up to 255 characters on separate lines.
20. Text Area(Long): 
Allows users to enter up to 131,072 characters on separate lines.
21. Text Area(Rich): 
Allows users to enter formatted text, add images and links. Up to 131,072 characters on separate lines.
22. Text(Encrypted): 
Allows users to enter any combination of letters and numbers and store them in encrypted form.
23. URL: 
Allows users to enter any valid website address. When users click on the field, the URL will open in a separate browser window.
How to create a field in Contact object:-
- Login to your Salesforce account.
- Go to setup.
- Search for Contacts in Quick Find/Search box then clicks on Fields.
  4. Then clicks on the New button.
  5. Select any one data type and then clicks on the Next button.
  6. Enter a name of the field and then clicks on the Next button.
  7. Select Field-level security according to your needs and then clicks on the Next button.
  8. Select the Page Layouts to include this field and then clicks on Save button.






 
 
Comments
Post a Comment