Hello guys, as we have discussed about the objects in our previous blog.
If you don’t know about Salesforce objects, you can go through the article by clicking the above link.
Now, we are going to discuss about fields and relationship in Salesforce. In every programming language, we have some data type for storing the data and storing the object attribute. Example:- We have a fan as an object. Now fan associates with some attribute like model name, price, brand, speed, color. For storing these data, we need a different type of fields with the various data type. So, generally, we use String for storing the name, model number brand.
Now, let’s talk about Salesforce fields. As we know that Salesforce is hot technology in the market. So, it provides some standard data types. You can create any field under the object. First choose any object, on which you want to create a field and click on “field and relationship.” There are total of 21 types of fields in Salesforce and two relationship type(the relationship between two objects).List of salesforce field data type:-
Auto Number:- As the name suggests that this is an auto increment number when you create a record for the object. This field data auto increase by one.
Formula:- In this type, you can write a formula for something. Like, if you want to divide the one field value by other field value, then you can use this type of field. It will give you output.
Roll-Up Summary:- It is a read-only field. You can’t edit it. It provides some useful functionality. Using this you can get the sum, max, min of field and you can also get a count of related(child) records.
CheckBox:- It is a boolean type of field. You can use this field for true and false.
Currency:- It is used to store the price of anything. You just need to enter the integer number, and it converts into the price like put the ‘ $ ‘ sign and any specific currency.
Date:- Date used for storing the date. And it will show you a popup of the calendar. So you can choose the date by a simple click.
Date/Time:- It is also the same as a date field. But it is also store time.
Email:- It is used for store the email. When you enter the value of this field, it also checks proper format and also validate your data that it is email or not.
Geolocation:- Allow user to define locations, Includes latitude and longitude components.
Number:- It allows the user to store the normal number.
Percent:- It allows the user to store ‘%.’ Suppose you enter 98 in this field. It will convert it into 98%. It will add the ‘%’ sign automatically.
Phone:- It allows you to store phone number in this field.
Picklist:- It provides a choose option. Suppose you need to show the option ‘salesforce administrator’ and ‘salesforce developer’ then you can use this type. A user only able to choose one option like a radio button of HTML.
Picklist(Multiselect):- It is also known as multipicklist. It allows us to choose more than one option from the list like a checkbox in HTML.
Text :- Text allows you to you can store the number and character in this field together. It has some limits.
Text Area:- Text Area field allow you to store 255 characters into separate lines.
Text Area(Long):- In the long text area, you can store 32,000 characters in separate lines.
Text Area(Rich):- In the rich text area, you can store 131,072. You can also store image and URL in this field.
Text (encrypted):- This is basically used for store the sensitive data like password, credit card details, etc. There is some option which is allowed to choose how your data will show in the field.
Time:- It allows you to store time.
URL:- This type of field use for store the addresses of the website. It allows to open the site in the next window.
Note:- you can also use the primitive data type of field in development like String, Integer, etc. In the next blog, we discuss the relationship of salesforce.
I hope after reading this article, you have more clarity about Salesforce Field Data Types. For more of these kind of articles stay tuned. Happy Coding!You can join
Salesforce Whatsapp Group.Together we can learn faster!
References
API Data Types and Salesforce Field Types