A data model is a way to represent the tables in the database which makes sense to humans, they help in understanding the relationship between different objects and Salesforce provides a\u00a0very intuitive way to model the database.<\/p>\n
In the database a table is equivalent to an object, fields of the object are referred as a column of the table and a row of this table is known as a record. The data model is a collection of these objects and field in an app.<\/p>\n
There are many types of objects supported by Salesforce like standard object, custom object, external objects, Big Objects and Platform events. We are going to stick with standard and custom object for now.<\/p>\n
Standard objects are the objects which are already created by Salesforce and are useful when it comes to the core of the Salesforce i.e. CRM, all the objects which are common and relevant to CRM is already present in Salesforce, for e.g. Account, Lead, Contact, Opportunity etc.<\/p>\n
Custom Objects are the objects which are created if the standard out of the box objects is not able to satisfy a business need or requirement. A custom object could be anything like a student object, property object, room object etc.<\/p>\n
Objects are basically a blueprint of a type of information, i.e. each record will have more or less exactly the same information if not less. Salesforce not only provides the intuitive way of creating an object it also creates few pages for us with writing a single line of code i.e. detail page and other page layout for the User interface.<\/p>\n
Let\u2019s find out how to create a custom Object (steps for Salesforce Classic):<\/p>\n
<\/p>\n
3. It will take you to a screen where you will list all the custom sObject and some information about them as well, you will find a button in the middle of the screen New Custom Object, click on this button.<\/p>\n
<\/p>\n
4.\u00a0This will bring you to the page where you define your new objects like its label, Plural label, API Name (Object name), its description what should be the type of the record name i.e. text or auto number<\/p>\n
Then some other properties like Allow reports, activities, track field history deployment status, search status and feature of adding notes and attachment<\/p>\n
<\/p>\n
<\/p>\n
5.\u00a0Once you have completed filing in the information, click on save and if you don\u2019t see any error message then you have successfully created an object and would be directed to the object detail page.<\/p>\n
And that is how you create an object, the properties you define on the object detail page will mold the behavior of your object in the Salesforce Platform.<\/p>\n
Now since we have created a bigger container to hold information (Object), let\u2019s know about how many fields and types of field are there to store relevant information.<\/p>\n
There are broadly four types of field:<\/p>\n
There are many types of data type to indicate what kind of information a field is holding, few of the data types are \u2013 data\/datetime, checkbox, picklist, currency etc. Following are the steps to create a custom field on account object (Salesforce Classic).<\/p>\n
And that is how you create a field.<\/p>\n
Some tips to implement before you start customizing your org,<\/p>\n
Data model is incomplete without defining any relationship between two objects, so now let\u2019s dive deep into the object relationship<\/p>\n
What are Object\u2019s Relationships and how do they affect the data integrity in the salesforce? How many types of object relationship does salesforce Support? These are the type of question arises in one\u2019s mind when we talk about Object relationship in salesforce.<\/p>\n
To being with salesforce supports two type of relationships namely lookup and Master Detail. Lookup up relation is basically linking two objects and one object can access fields of other object through this relationship, where as master detail relationship is a bit more tightly linked to each other. In this one object is master and other is its detail or I should say one is parent and other is its child object. In MD relationship some behavior of child objects are governed by the master object.<\/p>\n
Lookup relationship can be on- to-one or one-to-many, when two objects are linked as lookup relationship, means that they are sometime related and sometime not for example a contact object can be associated to account but it can be just a contact in itself, but this is not the case in Master Detail relationship. Master detail relationship does not work as standalone and the child object has to specify its master or parent object before it can be stored in database.<\/p>\n
The link between master detail is such that when the parent record is deleted then the child record also gets deleted, but this not the case for lookup when one of the look up record is deleted only the field referring to the linked objects get deleted.<\/p>\n
There is one more relationship available but only for User object, it is known as hierarchical relationship, where a hierarchy is established a management chain between the user objects.<\/p>\n
Steps to create a relationship field is same for both look up and master detail with few minor changes, lets create a look up first.<\/p>\n
For Master detail relationship select MD on step 3 and follow the remaining steps as above.<\/li>\n<\/ol>\n
<\/p>\n
You can see your data model in action by using the salesforce very own schema builder, this tool helps you visualize your data and their relationship with each other. To reach schema builder go to setup and type schema in the quick find box and click on schema builder it will take you to a screen similar to this<\/p>\n
On this canvas, object can be dragged and dropped and it will not change their relationship, this way we can easily visualize the relationship. Schema builder is not only used to visualize data but also to create new elements like Objects and fields, which can be created directly in schema builder.<\/p>\n
To create an object, select element tab on the left hand side bar and drag the Object element to the canvas and enter the required information and click save and that is it the new object is created, similarly, to create a field from the element tab select the required field and drag n drop it on the desired object, enter the respective details and click save and this is it, you have created a custom field on the selected object.<\/p>\n
Salesforce and any other CRM platform is data driven and therefore it\u2019s a platform\u2019s responsibility to provide simple user friendly way of managing this data, whether it Is data import or export. To manage Data in salesforce there various ways some are built in feature of Salesforce like Data import wizard and data export utility then there are many 3rd<\/sup> party applications like data loader (desk top application), Dataloader.io, Command line interface of Data loader (automatable).<\/p>\n Salesforce offers two main method of importing data.<\/p>\n But importing data is not as simple as it seems like, we have sometime pre import and post import task and similarly pre and post export tasks, like validating the import. Follow these steps to prepare data for importing.<\/p>\n Let us now start using Data import wizard:<\/p>\n For this purpose again salesforce has provided the native functionality that can be found on the platform and we have 3rd<\/sup> party app like data loader to perform export task for us. Here we will discuss the export wizard only.<\/p>\n The native Data export let\u2019s you export all of your data in the salesforce, to go export wizard type data export in quick find box and click on Data Export.<\/p>\n Once the data export home screen is reached there are two option one is export now which will straight away\u00a0start the exporting operation and other is schedule export which automates this process and make it a recurring event. Let\u2019s click on the export now button, this will take you to the screen where you can select the export service, here you get an option to select all data or some selected objects. There is also an option to select image document and attachments and content versions. Once the desired objects are selected click on start export, you will then be redirected to the detail page of the export and you will receive an email with the link to the page where we can download the exported data. Once the export procedure is completed it will add a link to the exported file. The file is in zip format and can be downloaded to the local machine from there. The file is present at this location for a limited time i.e. 48 hours, download the file before this time or you have to repeat this procedure again. Download as shown below. Similarly we can schedule the data export, from the home screen of data export click on schedule data export and this will take you to the screen similar to data export object selection screen, the only difference is the option to select the frequency of this export, here you can select day of the month and the duration of this service, as shown below One can use this feature to download the data or export from one org and then automatically import this to other org using the Command line Data loader.<\/p>\n That is it from this post, reach out to me if you have any concern, Happy coding.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":" Data Model and Management Data Model A data model is a way to represent the tables in the database which makes sense to humans, they help in understanding the relationship between different objects and Salesforce provides a\u00a0very intuitive way to model the database. In the database a table is equivalent to an object, fields of … \n
\n
\n
<\/li>\n
<\/li>\n
<\/li>\n
<\/li>\n
<\/li>\n
<\/li>\n
<\/li>\n
\nNext Come Data Export:<\/h1>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
Continue reading Data Model and Management<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[81],"tags":[40,79,61,74,45,75,38,42,55,51,52],"class_list":["post-933","post","type-post","status-publish","format-standard","hentry","category-admin","tag-apex","tag-apex-trigger","tag-dml","tag-dynamic","tag-dynamic-soql","tag-dynamic-sosl","tag-salesforce","tag-salesforce-apex","tag-salesforce-interview-questions","tag-soql","tag-visualforce"],"_links":{"self":[{"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/posts\/933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/comments?post=933"}],"version-history":[{"count":4,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/posts\/933\/revisions"}],"predecessor-version":[{"id":2205,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/posts\/933\/revisions\/2205"}],"wp:attachment":[{"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/media?parent=933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/categories?post=933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/tags?post=933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}