Data Types And Field Types in Salesforce Tutorial.
Last updated on 19th Jul 2020BlogTutorials
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
- 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
Currency, Formula, number, percent and roll-up summary.
Varies by type
DIFFERENT FIELD TYPES
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.
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.
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 field type allows user to enter INR or any other country currency values in the record.
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.
Allows users to enter Email address.
Allows users to enter altitude and longitude values.
Allows users to enter numbers.
Automatically percentage sign is added .
Allows users to enter Phone Number.
Allows users to select only on list from a group of lists that we defined. Picking one among many.
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.
Allows users to enter any combination of letters an numbers and store them in encrypted format.
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 field is a read-only field that displays sum, min, max values of a field in a related list.
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 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.
Picklist (multi-select) :
Allows users to select many from a group of list that we defined.
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.
|Blob||A collection of binary data stored as a single object.|
|Boolean||A value that can only be assigned true, false, or null. For example:Boolean isWinner = true;|
|Date||A 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.|
|Datetime||A value that indicates a particular day and time, such as a timestamp. Datetime values must always be created with a system static method|
|Decimal||A number that includes a decimal point. Decimal is an arbitrary precision number. Currency fields are automatically assigned the type Decimal.|
|Double||A 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;|
|ID||Any valid 18-character Force.com record identifier. For example:ID =’00300000003T2PGAA0′;|
|Integer||A 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;|
|Long||A 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;|
|String||Any set of characters surrounded by single quotes. For example,String s = ‘The quick brown fox jumped over the lazy dog.’;|
|Time||A 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 Force.com. 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 a:Trigger.new
- 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 Force.com 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.
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.