Apex assigns a data type in Salesforce to all variables and expressions, such as sObject, primitive, or enum. We use these data types as required depending on the condition. Integer, Double, Long, Date, Datetime, String, ID, or Boolean are examples of primitives. Data types in Salesforce.
Salesforce Data Type | Range and Description | Transformation Data Type |
AnyType | Polymorphic data type that returns string, picklist, reference, boolean, currency, integer, double, percent, ID, date, datetime, URL, or email data | String |
Base64 | Base64 encoded binary data | String |
Boolean | Boolean (true/false) values | Integer |
Byte | A set of bits | String |
Combobox | Enumerated values | String |
Currency | Currency values | Decimal |
DataCategoryGroupReference | Types of category groups and unique category names | String |
Date | Date values | Date/Time |
DateTime | Date and time values | Date/Time |
Double | Double values | Decimal |
Email addresses | String | |
Encrypted String | Encrypted text fields contain any combination of letters, numbers, or symbols that are stored in encrypted form | String |
ID | Primary key field for a Salesforce object | String |
Int | Fields of this type contain numbers with no fraction portion | Integer |
Master record | ID of the merged record | String |
Multipicklist | Multiple-selection picklists, which provide a set of enumerated values from which you can select multiple values | String |
Percent | Percentage values | Decimal |
Phone | Phone numbers | String |
Picklist | Single-selection picklists, which provide a set of enumerated values that you can select one value from | String |
Reference | Cross-references to another Salesforce object | String |
String | Character strings | String |
Textarea | String that appears as a multiple-line text field | String |
Time | Time values | Date/Time |
URL | URL values | String |
Fields come in various types, including text, number, picklist, date, and more, and they are employed to house data that pertains to a particular object.