• No results found

Try It Out: Define the Position Custom Object

In document Salesforce Creating on Demand Apps (Page 48-52)

To create the Position custom object, we’ll go back to the Setup area.

1. From Setup, enter Objects in the Quick Find box, then select Objects.

2. On the Custom Objects page, click New Custom Object.

Unlike defining a custom app, which we did through the New Custom App wizard, defining a custom object is confined to just one page. You'll find that the platform uses wizards or single pages depending on the amount of information that needs to be specified.

Custom Object Definition Page

3. In the Label field, enter Position.

4. In the Plural Label field, enter Positions.

5. The Object Name field is defaulted to Position. Let's leave it as is.

The Label and Plural Label of a custom object are what users see in all of the object's related user interface elements, such as the object's tab or in search results headings. Object labels work best as nouns, and the plural label is always used to label a custom object's tab (if you create a tab for your object).

The value of a custom object's Object Name represents the unique name for the object when it's referenced in other areas of the platform, such as formulas and Visualforce pages. This value is helpfully auto-generated based on the value that you enter for the Label, except that all spaces and punctuation are replaced with underscore characters. We'll talk more about formulas and Visualforce later in this book.

For now, keep in mind that the Object Name value must be unique across all objects defined in your organization.

Note: Within the platform, Object Name is actually stored with __c appended to the end as a suffix (for example, Position__c). This identifies it as a custom object.

6. In the Description field, enter This object stores information about the open job positions at our company.

7. For the Context-Sensitive Help Setting, accept the default. If you later want to provide customized help documentation for your users about this object, you can come back and

choose the option.

The Record Name is the label for the field that identifies individual position records in the system.

Salesforce automatically populates Record Name with the custom object label followed by Name. In this case, the field is populated with Position Name. A custom object cannot be saved without this identifying field.

8. In the Data Type drop-down list, select Text.

The Data Type drop-down list allows you to select the type of value used for this identifying field:

either Text or Auto-Number. Some objects, like Positions or Accounts, can be identified with a text field because there will always be a name for a position or account available. Other objects, like a Case (used in the standard Call Center app) are harder to identify with a single text field, so we assign them auto-numbers instead.

Tip: Whenever possible, it's best to use text as the data type for an identifying field so that users can more easily identify a particular record when several of them appear together in a single list.

To illustrate how custom object and record name labels work together in the app, let's fast forward a bit to see where each label will appear once we've defined our Position custom object, its tab, and a single Sr. Developer position record.

Custom Object and Record Name Labels

Let's move on.

9. In the Optional Features area, select Allow Reports, Allow Activities, Allow Search, and Track Field History.

These three checkboxes actually enable some really robust functionality.

Allow Reports

Selecting this option makes the data in the position records available for reporting purposes. The platform comes with a large number of standard reports, and users can also create custom reports by using a simple yet powerful report builder. (To find out more about reports, see Analyzing Data with Reports and Dashboards on page 279.)

Allow Activities

Selecting this option allows users to associate tasks and scheduled calendar events with a particular position. For example, a user can create a task, such as “Update salary range for Sr. Developer position,”

and specify attributes such as priority, due date, and status. The user can then handle the task or assign it to someone else. (To find out more about tasks, see “Activities” in the Salesforce Help.)

Track Field History

Selecting this option allows the platform to automatically track edits to position records, such as who changed the value of a field, when it was changed, and what the value of the field was before and after the edit. History data is available for reporting, so users can easily create audit trail reports when this feature is enabled. (To find out how to select which data is tracked, see “Track Field History for Custom Objects” in the Salesforce Help.)

Note: Allow Search is selected by default in Developer Edition organizations.

In general, select these options if there's any chance that they might be useful for whatever custom object you're defining.

10. In the Deployment Status area, select Deployed.

Note: This step assumes that you're working in a development environment. If you're not, and if you don't want users to see the Position object after you click Save, select In

Development. Setting the status to In Development hides position records from all users except those with the “Customize Application” user permission (that is, just about anyone who isn't a System Administrator).

11. In the Object Creation Options area, select the Add Notes & Attachments related list to default page layout and Launch New Custom Tab Wizard after saving this custom object checkboxes.

These two options are available only when you're creating a new custom object. If you later decide to go back and edit some of the details about your custom object, you won't see them. But what do they do?

Enabling notes and attachments for an object means you can attach external documents to any position record, in much the same way that you can add a PDF or photo as an attachment to an email.

It's handy functionality, so select it.

Launching the New Custom Tab wizard does exactly what it says—it's a shortcut to launching the tab wizard after we've saved our Position object, and will save us a few clicks if we know that we need a tab.

All set? Let's go ahead and save our Position custom object now.

That's all there is to it! As promised, the New Position Tab wizard is displayed instead of the list of custom objects that we'd normally see. Let's take a moment to talk about why we should even be defining a tab for our Position object in the first place. What's so great about tabs, anyway?

In document Salesforce Creating on Demand Apps (Page 48-52)