The page shown in the figure above looks pretty bare, as there are no records within this object. Even if you click New, you only bring up the page shown in the following figure, where there admittedly is not much going on.
You have to add some fields to the object to make the object more useful.
1. | Click Setup
Create
Objects to display the Location object in the object list. There are three ways you can get to the Location object from this page. The Edit link takes you to a page to edit the values you entered in the last section, except for the inclusion of the Notes and Attachments option. You can still add the Notes and Attachments section to a tab page after creation, but you have to do it through the Page Layout, as you will see shortly. The Del link deletes the object, after confirmation from you. When you delete an object, you also delete the associated data. By default, deleted objects and their data are kept for 45 days, during which time you can either restore them or erase them permanently from the Force Platform. The link for the name of the object takes you to a page where you can specify most of the attributes for the object, as you will see in the next step. Clicking on the name of the object takes you to the page you will use most often in your development efforts. Voice of the Developer
| ||||||||||||||||||||||||||||
2. | Click the Location link to display the page shown below. This page includes a large number of attributes for your object. You will learn about all of them over the course of the next few chapters, but for right now, only the first three require descriptions:
Figure 23. Detail page for the Location object | ||||||||||||||||||||||||||||
3. | Click New in the Custom Fields & Relationships section to display the page whose upper section is shown in the following figure. This first page of the field definition process is used to select the data type for your new field. The page is divided up into three basic sections:
Figure 24. Defining a custom field’s data type | ||||||||||||||||||||||||||||
4. | |||||||||||||||||||||||||||||
5. | Enter Street Address for the Field Label, limit the Length of the field to 2,000 characters, and set the number of visible lines as 4. You can see that when you enter a Field Label, the Field Name is automatically defaulted to the label, with underscores in the place of spaces. As you will see, the actual name of the field, like the name of the object, is the name listed on this page followed by two underscores and the letter ‘c’ (__c). Voice of the Developer | ||||||||||||||||||||||||||||
6. | Enter a description for the field and some help text for this field. | ||||||||||||||||||||||||||||
7. | Click Next. The next page gives you the ability to impose field level security restrictions on your new field. You will learn about security in Chapter 7: Protecting Your Data of this book, so you can accept the defaults on this page. | ||||||||||||||||||||||||||||
8. | Click Next to bring up the page shown below. This page provides a recap of the most important attributes you have defined for your new field, as well as the ability to include this field in a Page Layout for its object. Figure 26. Custom field attributes and inclusion on page layouts | ||||||||||||||||||||||||||||
9. | You will modify the Page Layout later in this chapter, so for now you can click Save and New to accept the default of adding the field to the page layout and complete the creation of this field and define another field. This action takes you back to the Data Type page for your next field. | ||||||||||||||||||||||||||||
10. | Define the rest of the fields for the Location object with the attributes specified in the table below, accepting the default security and page layout options for each.
As you define these additional fields, you will see that the detail options differ based on the data type you have specified for each field. For example, there are three checkboxes available for the Text fields you define, which allow you to specify that the value for the field is required, or that the value must be unique. These two attributes would not really make sense for a Text Area, which is typically used to hold optional data. Similarly, you are not prompted to enter a length for a field with a data type of Phone. This special data type automatically formats phone numbers entered by the user. The checkbox for an External ID will become more meaningful when you learn about relationships in Chapter 3: Relationships. | ||||||||||||||||||||||||||||
11. |
The fields you have just entered are listed in the Custom Fields and Relationships section of the Location object detail page in alphabetical order.
3.145.71.115