In this episode of ShellBlack Whiteboard we introduce Custom Objects – a way to extend the Salesforce database and track information that is not a good fit for Standard Objects. Though covered in more depth in other episodes, Shell goes over how you leverage a lookup field to relate or tie a custom object to other objects in either (1) a "one-to-many" relationship or (2) a "many-to-many" relationship. Lastly he goes over how licenses determine the number of Custom Objects you are able to create in your Salesforce org.
View this video on YouTube: http://youtu.be/F9PT4-JoTuI
Part 2 on Custom Objects: "Master-Detail" Data Relationship
Part 3 on Custom Objects: "Many to Many" Data Relationship
Transcript of video:
Hello everyone. I’m Shell Black, president and founder of ShellBlack.com and Salesforce MVP. This episode is one of the most requested episodes. It’s custom objects, something you gave me feedback on Twitter and email that you wanted me to cover. With that, let’s jump into it.
Let’s talk about first what is a custom object. A custom object is a new table in the database so you can store information. When you’re considering a custom object or something that you want to record in the database, you should probably look first to see if it’s a fit for your standard object. If it’s a person, should that be a Lead or a Contact? If it’s something with a physical address or a business entity, should that be an Account? If I’m looking at a potential revenue opportunity, should that be an Opportunity?
Sometimes, something that you want to track in the database is not a good fit for a standard object. It’s something else, and when you have something else, that’s a good candidate for a custom object. A couple of examples. You might have a job application or survey, an expense report, a time card, a project, a vacation request, a loan or an insurance policy. None of those things I just talked about are a good fit for a standard object. It’s something else.
If you think about a custom object, you can think of it in terms of an Excel workbook. I’m sure Salesforce probably cringes when I say think of Salesforce and Excel workbook, but I think it’s a fairly good analogy. If you think of a workbook in Excel and you have a tab for all your standard objects, a Lead tab, Accounts, Contacts, Opportunities, Cases, whatever it might be, when you create a net new tab or worksheet in a workbook, that’s almost the same thing that you’re doing in Salesforce. You’re extending the database by adding another worksheet or another table in the database.
When you create a custom object, you have all the features available that you have with standard objects. You have things like page layouts, custom fields, security if you need to hide or restrict access to that custom object all the way down to field level security, and reporting, activities. You can have attachments. You can have Chatter. You can write cross object formulas which is really handy, and workflow and validation rules. Pretty much all the features that you have available with a standard object are available with custom objects.
Let’s flip sides of the board real quick. How do you tie a custom object to other tables in the Salesforce database? You do that with a lookup field. A lookup field is a way you can make a connection to another table. Let’s say that you have a survey object that you created with all your fields that you have on your survey, but you want to relate or tie that survey custom object to a Contact. You would do that through a lookup field to the Contact object.
When you have lookup fields, you now have data relationships that you need to be thinking about in the database. These are going to be separate episodes in more depth, but I want to give you some quick highlights. Let’s take that example I was just talking about with the survey custom object with a lookup field to the contact. That’s a "one-to-many" relationship. One Contact can have multiple surveys. You might have a survey they took this week, next week, three weeks from now, whatever it might be. You could have multiple records associated to a single object in a "one-to-many" relationship.
In that separate episode, we’re also going to talk about "master detail" relationships where we can roll up or summarize information from child records. We’re not going to get into that today.
The other thing you can do is a "many-to-many" relationship. We have two lookup relationships on an object. Let’s say that you have a job application. A job application could be related one way to the job posting or the position. It can also have a lookup relationship based to the Contact. Now you have a "many-to-many" relationship. One Contact can have multiple job applications against multiple job postings. Conversely, one job posting, you could see all the Contacts that applied for that job position. We’ve kind of basically made a "join" object. That job application is a join between the Contact object and the job position. Again, we’re going to do another example, another episode, more in depth to make that more concrete, but just realize when you have two lookup relationships you could have a "many-to-many" relationship.
When you create a custom object, you can also create a tab. You can give it an icon. Maybe it’s an expense report. You can give it a little airplane icon or the globe. Then, if you have a tab for your custom object, that can be included into an app or a custom app. We’re going to have another episode on custom apps. Just realize that’s an option.
Something you need to know is that you have limits based on your license type with Salesforce on how many custom objects you can create. If you have Professional Edition, which I’m abbreviating with PE, you can have up to 50 custom objects. With Enterprise Edition, EE, you can have 200. Unlimited, or the Performance Edition, you can have 400 custom objects. Developer, 400 custom objects. If you have a Force.com license, you can have 10. I put an asterisk on the Force.com license, because there are actually some older versions of the Force.com license that allow for more than that.
Okay, that wraps up our episode on custom objects. I hope you enjoyed that. You can give some feedback on how we’re doing a couple of different ways. You can hit us on Twitter. I’m @Shell_Black. Or, you can send us an email email@example.com. We would love to hear from you. Stay tuned for some new episodes. Hope to see you soon.