,

Record Types

Dependent picklists give you a way to add flexibility to your use of picklists. You can limit the entries in one picklist based on the entry in another picklist. The Force Platform also includes a way to limit the display of picklist values based on a different criterion. This functionality, and more, is delivered through the concept of record types.

Record types allow you to define multiple user interfaces for data stored in the same object. Users are grouped in profiles, which is discussed in Chapter 7: Protecting Your Data, and record types are assigned to one or more profiles.

Every object in your Force Platform data store can have more than one record type. Each record type has two areas of presentation options—the ability to define a record type’s page layout and to limit the values available for a picklist for that record type.

As with most Force Platform features, the best way to understand how record types are used is to simply create some. You want to use record types with the Position object—one record type with a particular page layout and picklist values for technical positions, and another for non-technical positions. Before you can create the record types, you have to create an alternative version of the existing page layout to use for non-technical positions.

1.
Select Setup Create Objects Position.

2.
Scroll down to the Page Layout section and click New.

3.
In the next page, shown completed below, select the Position Layout as the Existing Page Layout, and give the new page layout the name of Non-Technical Position Layout.

Figure 50. Non-Technical Position Layout


4.
Click Save, which will bring up the new page layout. Click Edit to edit the layout and drag the field for Programming Languages from the Information section to the Position Fields box in the lower right.

5.
Click on Save to create your new page layout and return to the page for the Position object. You are now ready to create two record types for this object.

6.
Go to the Record Types section and click on New to bring up the page shown below.

Figure 51. Defining a new record type


7.
Leave the –Master– record type as the Existing Record Type and enter Technical Position as the Record Type Name, with an appropriate description. Make sure to check the Active checkbox.

8.
Leave the Enable for Profile checkbox checked for each of the profiles listed. Once you enable a record type for a profile, you can designate the record type as the default record type for the profile. Although you may want to do this in your own application, you should not use this option before you see how users can choose record types later in this section. Click Next to bring up the page shown below.



Figure 52. Assigning record types


9.
Leave the Apply one layout to all profiles option selected, and choose the Position Layout as the layout. You can create a separate page layout for this record type, but the Position Layout includes all the fields that you want to include for technical positions.

10.
Click Save.

11.
Click the Edit link for the Department picklist to bring up the page shown in the following figure.

This page allows you to prevent certain picklist values from appearing for Position records of this record type. Technical positions will only be posted for the Engineering, IT, and Support departments, so you will want to remove the other departments from this picklist.



Figure 53. Defining picklist values for record type


12.
Select the Finance and Sales values in the right-hand picklist and move the to the Available Values list box on the left.

13.
Select Engineering as the Default in the picklist at the bottom and click Save.

14.
Return to the Position object with the link at the top of the page and click New in the Record Types section to create another record type.

15.
Give the new record type the name of Non Technical Position, an appropriate Description, and make the profile Active.

16.
Enable the record type for all the profiles and click Next. Of course, in your own application, you may not want to make all record types available for all profiles.

17.
Assign the Non-Technical Page Layout to the new record type and click Save.

18.
Edit the Department picklist and remove the Engineering, IT, and Support choices from the Available Values list. Click Save.

Your record types are defined for your users. Time to see them in action.

19.
Click on the Positions tab in your application.

20.
Click on New, which will bring up the page shown below.



Figure 54. Selecting a record type for a new record


21.
Select the Non-Technical Position record type and click Continue.

Your new page layout displays as shown below, complete with the reduced set of picklist options for the department. Since the Department picklist is the parent for the Salary Grade picklist, your record type has essentially prevented the non-relevant entries for salary from appearing for this type of Position.

Figure 55. Record type at work


Record types provide a lot of flexibility for your Force Platform application, but some of your users might not need this flexibility since they are only creating one Position record type. You can eliminate this step by assigning a default record type for an object. The user then chooses to use the default record type at all times in the Record Type Selection option in their Personal Setup menu.

Record types and records

Keep in mind how record types actually interact with your Force Platform applications and data. When creating an object containing record types, the user can only select record types allowed for their profile. The selected record type used to create the record is then associated with that record, and used to determine the display of the detail page for the record.

However, users can view all records without concern for record types. A user can see records with a record type that they will not be allowed to assign. The user can even change the record type of a record to any available record type. The record type limitation imposed by profiles is only enforced when a record is created.


Record types and picklists can expand the interface possibilities for your objects, but always keep in mind that you are only limiting the user interface—not the actual data stored in your Force Platform object. Chapter 7: Protecting Your Data focuses on Force Platform security, which you use to actually define the access to data within an object.

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

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