Entering and Browsing Data

One of the happy consequences of building a database in Force.com is that you receive a full-featured data maintenance user interface with near-zero development cost. It is the “native” Force.com user interface. It allows users immediate access to your data with a consistent look and feel, and helps developers visualize and test decisions related to database design.

It’s good practice to use the native user interface to test your data model by creating records with dummy values. This helps identify missing fields, nonintuitive page layouts, and additional validation rules needed. After your object contains some records, browse them using Views and Search. Customize Views to show the optimal set of columns. Usable Views are helpful later in the development process for troubleshooting data problems.

Getting Started

Salesforce often adds new features that users must opt in to use. For example, users must opt in to features that involve significant changes to the user interface. Salesforce recently released a faster, more powerful user interface for working with lists of records and for editing records with fewer clicks. Before starting this section, check to make sure your org has these features enabled. Go to the Setup, App Setup area, click Customize, User Interface, and then check the Enable Enhanced Lists and Enable Inline Editing options; click the Save button.

Entering Data

Custom tabs are containers for developer-defined user interfaces. These tabs, such as the Home tab, are displayed at the top of the page. Tabs are the gateway to the native list view and CRUD user interfaces for an object and can also present entirely custom user interfaces built in Visualforce.

If you have not created a custom tab for your object, do so now by going to Setup and, in the App Setup area, clicking Create, Tabs. Click the New button in the Custom Object Tabs section. In the details page, select your custom object from the drop-down list, pick a tab style, and optionally enter a description. Skip through the remaining pages, accepting the default values.

To create a new record in your custom object, click the Create New drop-down on the left side of the screen and select your object from the list. An edit screen is shown, as in Figure 2.4, which shows editing a new record in the standard object named Contact. This screen is defined by the page layout. Make note of things you don’t like as you enter test data and return to the page layout to fix them. This process is identical for standard and custom objects.

Image

Figure 2.4 Creating a new record in the Contact object

When your new record is saved, the page changes to a view mode. This is also controlled by the page layout. If you’ve enabled Inline Editing, you can double-click the editable fields to change their values.

Browsing Data

Your first encounter with a list of records is usually on the home page of your custom object. Click your custom object’s tab, and you’ll see a section listing recently viewed records. It shows only the Name of your records. To customize this list of recently viewed records to show more fields, go to the custom object definition, Search Layouts section, and edit the tab layout to add more fields. Figure 2.5 shows an example of the Contacts Home tab layout with Name, Account Name, Title, Phone, and Email fields visible.

Image

Figure 2.5 Contacts Home tab

Another way to browse data is a View. A View is a native user interface that displays the records of a single object as a list. It includes such features as sorting, pagination, columns that can be dragged to reorder, and the capability to delete and edit data in-line without switching to another user interface. To define a View, you specify the list of fields to be displayed and, optionally, filter criteria to restrict the list to a manageable size.

To show a View on your own object’s data, click its tab and then click the Go button. This displays the selected View, which is All by default. Unless you’ve already customized your All View, it contains only the Name field. Customizing Views is another task, like building tabs and page layouts, that can increase developer productivity, even if you don’t plan to use the native user interface outside of administration. Figure 2.6 shows a custom object’s View.

Image

Figure 2.6 View of custom object

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.25.112