Different Data Types in Salesforce

Apex in Salesforce assigns a data type to all variables and expressions, such as sObject, primitive, or enum.

  • Integer, Double, Long, Date, Datetime, String, ID, or Boolean are examples of primitives 
  • An sObject, such as an Account, Contact, or MyCustomObject c, is either general or particular.
  • A collection that includes the following items:
    • A list (or array) of primitives, sObjects, user-defined objects, Apex classes-created objects, or collections 
    • a collection of primitives
    • A primitive-to-primitive map, sObject, or collection
  • An enumeration is a typed list of values 
  • Objects made from Apex classes defined by the user
  • Objects built with Apex classes provided by the system
  • Null (for the null constant)

There are different kinds of data types depending on conditions. The five different data types in API:

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

Variables in Salesforce

  • The syntax for declaring local variables, defining and initializing the multiple variables in a single line, is similar to that of Java.
  • If you declare a variable but don’t assign a value to it, it will be null. In its simplest form, null denotes the lack of a value. Any variable specified with a primitive type can also be set to null.
  • Variables can be declared at any point in a block and then take on scope from there. Sub-blocks can’t change the name of a variable that has already been used in a parent block, although parallel blocks may.

Want to know more about Salesforce? Read this extensive Salesforce Tutorial!

Different Salesforce Field Types Depending on the Data Types and their Transformation Data Types.

Data Type Field Types Transformation Data Types
ID Look up relational, master-detail relationship String
String Auto number, email, phone, multi-select picklist, text, text area, long text area, rich text area, data category group reference, and URL String
Boolean Checkbox Integer
Double Currency, formula, number, percent, and roll-up summary Decimal
Varies by type A type must be given when formula fields are added in the user interface. Currency, date, date/time, number, percent, or text are all API data types that correspond to this type. String

Learn more about Salesforce Automation System in this insightful blog now!

Get 50% Hike!

Master Most in Demand Skills Now !

Different Salesforce Field Types

Field Type Description
Address A compound data type that contains address field data
AnyType A polymorphic data type that returns a string, picklist, reference, Boolean, currency, int, double, percent, ID, date, DateTime, URL, or email data depending on the kind of field involved
Calculated A field that is defined by a formula
Combobox A Combobox, which includes a set of enumerated values and allows the user to specify a value, not on the list
Currency  Currency values
DataCategoryGroupReference Reference to a data category group or a category unique name
Email Email addresses
EncryptedString An encrypted text field that contains any combination of letters/numbers/symbols stored in an encrypted form; you can set up a maximum length of up to 175 characters; available in API versions 11.0 and later
ID A primary key field for an object
JunctionIdList A string array of referenced ID values representing the many-to-many relationship of an underlying junction entity; you have to query and manipulate the string array to query and manipulate the underlying junction entities in a single API call
Location A compound data type that contains latitude and longitude values for geolocation fields
Masterrecord When records are merged, the ID of the record that is saved (the other records are deleted)
Multipicklist Multi-select picklist includes a set of enumerated values from which multiple values can be selected
Percent Percentage values
Phone Phone numbers; values can include alphabetic characters; client applications are responsible for phone number formatting
Picklist Picklist includes a set of enumerated values from which one value can be selected
Reference Cross-references to a different object; analogous to a foreign key field in SQL
Textarea A string that is displayed as a multi-line text field
URL URL values; usually, client applications should display these as hyperlinks

Learn end-to-end Salesforce concepts through the Salesforce Course in Hyderabad to take your career to a whole new level!

Salesforce Components

  • TAB menu: In this, all tabs are arranged in a row.
  • All TAB menu: In this, you can find all the tabs available in salesforce.com.
  • More TAB menu: In this, you can find more tabs available in salesforce.com.
  • User menu: This is available at the top with a username. By using this component you can change your profile settings.
  • Sidebar menu: In this, there are different sections such as build, monitor, jobs, logs, etc.
  • Application menu: It allows shuffling between applications.
  • Search menu: It helps search in Salesforce.

Go for this in-depth job-oriented Salesforce Training Course now!

Course Schedule

Name Date
Salesforce Certification 2021-09-18 2021-09-19
(Sat-Sun) Weekend batch
View Details
Salesforce Certification 2021-09-25 2021-09-26
(Sat-Sun) Weekend batch
View Details
Salesforce Certification 2021-10-02 2021-10-03
(Sat-Sun) Weekend batch
View Details

1 thought on “Salesforce: Data Types, Field Types, and Components”

  1. Good tidings, Generally I never remark on online journals yet your article is persuading to the point that I never stop myself to say something regarding it. You’re working effectively, Keep it up. You can look at this article, may be of help 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *