Data Types & Field Types [Salesforce] Tutorial Learning Path - Complete Guide
The different data types and field types available in Salesforce Tutorial

Data Types & Field Types [Salesforce] Tutorial Learning Path – Complete Guide

Last updated on 19th Jul 2020, Blog, Tutorials

About author

Karthikeyan (Sr Technical Manager )

He is a Proficient Technical Expert for Respective Industry & Serving 11+ Years. Also, Dedicated to Imparts the Informative Knowledge to Freshers. He Share's this Blogs for us.

(5.0) | 15212 Ratings 3858

Salesforce is a leading CRM (Customer Relationship Management) software which is served form cloud. It has more than 800 applications to support various features like generating new leads, acquiring new leads, increasing sales and closing the deals. It is designed to manage the organization’s data focused on customer and sales details. It also offers features to customize its inbuilt data structures and GUI to suit the specific needs of a business. More recently, it has started offering the IOT (internet of things) connectivity to the CRM platform.

Salesforce started as a cloud based solution for CRM. CRM stands for Customer Relationship Management. It involves managing all aspects of relationship between an organization and its customers. For example, the contact details of the customer, the deals that are in progress or already completed, the support requests from a customer or a new lead from a new customer. Beyond the customer related information, it also involves storing and managing the details of the people and the concerned department from the seller organization that is managing the customer’s account and needs. This makes it easy to manage and enhance the relationship with the customer and hence better growth for the organization

Why Salesforce? Key Benefits

Here, are prime reasons for using Salesforce CRM:

  • It is a complete feature-rich solution for marketing, sales, service, partner management, and community management.
  • Salesforce data is stored in the cloud so your team can use it from anywhere in the world with the help of an Internet connection.
  • It caters to the needs of small as well as medium to large organizations.
  • Salesforce works on a pay as you go, model so there are no overhead costs.
  • Increase customer loyalty, retention, and satisfaction
  • Accelerates sales productivity
  • Salesforce can easily integrate with 3rd party apps.
  • Increase the growth of your business
  • Continuous optimization of campaigns can be done based on the market response and closure interaction with channel partners.

Data types and field types

Data types and field types in sfdc :In this tutorial we are going to know about What are the different data types, Different types of Field types. In General both data types and field types have the same names in the user names. We use different Data types depending on the condition.

Generally in API there are 5 different data types. They are

  • ID.
  • String.
  • Boolean.
  • Double.
  • Varies by type

We can group different field types depending on the Data types.


Look up relationship, master-detail relationship


Auto number, email, phone, multi select pick list, text, text area, long text area, rich text area, data category group reference and URL


 Check box


Currency, Formula, number, percent and roll-up summary.

Varies by type

Formula Field


Auto number : 

when auto number data types is selected a system-generated sequence number that uses a certain display format that we define. Auto generated number will be increment for every record we create.

Formula  : 

When Formula data type is selected we are able to derive different Formula expressions that derives values. The formula field is updated every time when there is a change in source field. It is a read-only field type.

Subscribe For Free Demo


Roll-up Summary : 

Roll-up Summary is also a read-only field type. By using this Roll-up Summary data types we are able to make some mathematical calculations like Sum, Minimum, Maximum values of a afield in a related list or the record count of all records listed in a related list.

Lookup Relationship : 

This type of Data type links two objects. we can link on object to another object by Lookup relationship. This data type field allows user to select a value from popup list.

Master-detail relationship : 

Master-detail relationship also links two objects but it creates a special type of parent-child relationship between the two objects.

Checkbox : If a user wants boolean function like true or false this Checkbox data types is used.

Currency : 

Currency field type allows user to enter INR or any other country currency values in the record.

Date : 

Allows user to enter date or we can select the date from popup calendar.

Date/ time  : 

Date and Date/Time field types are different from each other. In Date/Time the user can select date from popup calendar and also current time is entered in the Date/Time field.

Email :

Allows users to enter Email address.

Geolocation : 

Allows users to enter altitude and longitude values.

Number : 

Allows users to enter numbers.

Percent : 

Automatically percentage sign is added .

Phone : 

Allows users to enter Phone Number.

Picklist : 

Allows users to select only on list from a group of lists that we defined. Picking one among many.

Text :

 Allows users to enter combination of both letters and numbers.

Text Area : 

Allows users to enter up to 255 characters of letters and numbers.

Text area (Long) :

 Allows users to enter up to 32,768 characters on separate lines.

Text Area (Rich) :

 Allows users to enter formatted text, add images and links up to 32,768 characters on separate lines.

Text(Encrypted) : 

Allows users to enter any combination of letters an numbers and store them in encrypted format.

URL : 

Allows users to enter a valid website address.


 Auto-number is a system generated sequence number used to display format whatever we define. Automatically incremented for each new record.


 Formula field is a read-only field which gets values from formula expression that defined. Formula field type changes, when the source field changes.

Roll-Up Summary

Roll-Up Summary field is a read-only field that displays sum, min, max values of a field in a related list.

Lookup Relationship

Lookup Relationship field creates a relationship between two objects (parent object and child object). This field type, allows users to click on a lookup icon to select a value from a popup list.

Master-Detail Relationship

Master-Detail relationship field creates a specific type of parent-child relationship.


Checkbox field type allows users to select a True(checked) or False (Unchecked).


Currency field allows users to select a Dollar or any other country currency amount. This field type is used to export data to Excel sheets or spreadsheets.

Course Curriculum

Get Hands-on Practical Salesforce Training with Instructor-led Classes

  • Instructor-led Sessions
  • Real-life Case Studies
  • Assignments
Explore Curriculum

Picklist (multi-select) : 

Allows users to select many from a group of list that we defined.

Data Types:

A data type in a programming language is a set of data with values having predefined characteristics. Examples of data types are: integer,floating point unit number, character, string, and pointer. Usually, a limited number of such data types come built into a language. The language usually specifies the range of values for a given data type, how the values are processed by the computer, and how they are stored.

Apex is a strongly typed, object-oriented programming language. Just like any other  programming language, Apex has variety of data types that you can use.

1).Primitive Types – This data types include String, Integer, Long, Double, Decimal, ID, Boolean, Date, Datetime, Time and Blob. All these data type variables are always passed by value in methods.  Another point to note is in Apex, all variables are initialized to null when declared. You must explicitly initialize to non-null values before using. 

Data TypeDescription
BlobA collection of binary data stored as a single object.
BooleanA value that can only be assigned true, false, or null. For example:Boolean isWinner = true;
DateA value that indicates a particular day. Unlike Datetime values, Date values contain no information about time. Date values must always be created with a system static method.
DatetimeA value that indicates a particular day and time, such as a timestamp. Datetime values must always be created with a system static method
DecimalA number that includes a decimal point. Decimal is an arbitrary precision number. Currency fields are automatically assigned the type Decimal.
DoubleA 64-bit number that includes a decimal point. Doubles have a minimum value of -263 and a maximum value of 263-1. For example:Double d=3.14159;
IDAny valid 18-character record identifier. For example:ID  =’00300000003T2PGAA0′;
IntegerA 32-bit number that does not include a decimal point. Integers have a minimum value of  -2,147,483,648 and a maximum value of  2,147,483,647. For example:Integer i = 1;
LongA 64-bit number that does not include a decimal point. Longs have a minimum value of -263 and a maximum value of 263-1. Use this data type when you need a range of values wider than those provided by Integer. For example:Long l = 2147483648L;
StringAny set of characters surrounded by single quotes. For example,String s = ‘The quick brown fox jumped over the lazy dog.’;
TimeA value that indicates a particular time. Time values must always be created with a system static method.

2).sObject Types – This is a special data type in Apex. sObject is a generic data type for representing an Object that exists in It could be Standard object like Account, Opportunity etc., or Custom object that you define.  Following are some of the examples of sObject variables –

  • data-rich-text-format-boundary=”true”>Sobject s = new Account()
  • data-rich-text-format-boundary=”true”>Account a = new Account()
  • for(Account
  • data-rich-text-format-boundary=”true”>ustomObject__c c = new CustomObject__c();

As you can see above, your custom objects have an extension of __c to distinguish from the standard objects. Fields from the sObject variable can be accessed using the dot notation.

3).Collections – Apex has 3 types of collections. Lists, Sets and Maps.

  • A list is like an array, a sequential collection of elements with first index position as zero. List can contain elements of primitive types, sObjects, user-defined objects, Apex objects or even other collections. A list can contain up to four levels of nested collections. List can contain duplicate elements.
  • A set is also a collection of elements and elements can be of any data type. Unlike list, set contains unique elements and elements in set are not in any specific order.
  • A map is a collection of key-value pairs. Keys and values can be any data type. Keys are unique and map elements must be accessed by the key as the order of  map elements are not reliable.

Salesforce Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download

4).Enums – Just like in other programming languages, Enum type represents a fixed set of named constants.

An enum is a data type which contains fixed set of constants. It can be used for days of the week (SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY and SATURDAY) ,directions (NORTH, SOUTH, EAST and WEST) etc. The enum constants are static and final implicitly.


Salesforce has become synonymous with CRM. Organizations can use Salesforce for contact management, customer engagement, workflow creation, task management, and opportunity tracking. You can also collaborate with colleagues, run analytics, and access Salesforce from a mobile dashboard.

Are you looking training with Right Jobs?

Contact Us
Get Training Quote for Free