Sunteți pe pagina 1din 6

Tutorial 1: Create an App with the Force.

com Builder
Level: Beginner
2030 minutes

Overview
Using the Force.com builder, you will see how easy it is to create complete applications with simple point-and-click methods. In this Force.com tutorial, you will build an application to track the mileage a user travels to visit customers.

This tutorial consists of six steps; please proceed through them in sequence.
Step 1: Create a custom object Step 2: Create fields for the custom object Step 3: Create a tab Step 4: Put it all together to create an application Step 5: Test the application Step 6: Automatically assign record numbers to new records

Step 1: Create a custom object


The first step in creating an application is to create an object that will hold and persist the data; in this case, the mileage a user drives on a customer visit. On the Force.com platform, an object is similar to a database table. Your Salesforce applications already contain many such pre-built objectsknown as standard objectsfor all the data those applications need. However, you can also build objects to hold data that's just for your organization. Such objects are called custom objects. 1. Log into your Developer Edition org. a) Launch your browser and go to https://login.salesforce.com http://developer.force.com 1

b) Enter your Developer Edition username (in the form of an email address) and password. 2. Create the Mileage record custom object. a) Click Setup in the upper right corner to display the Personal Setup screen in the Force.com Builder environment.

b) Click App Setup > Create > Objects to display the Custom Objects page.

c) Click New Custom Object to display the New Custom Objects wizard and enter the following values for each of the fields: Label: Mileage Plural Label: Mileages Object Name: Mileage Description: An object that holds mileage information for a trip Leave all other values as they are (defaults).

d) Click Save to create your new object.

http://developer.force.com

Step 2: Create custom fields


Now that you have created the Mileage object that will hold each mileage record, youll want to add fields to capture the date of the trip, the number of miles driven, and the person visited. 1. Create the Date field. a) Locate the Custom Fields & Relationships tab. b) Click New to launch the Field Creation wizard.

c) For Data Type, select Date, click Next, and enter the following values: Field Label: Date Field Name: Date Description: Date of mileage report Check the Required checkbox Default Value: TODAY()

http://developer.force.com

d) Click Next, accept the defaults, and click Next again. e) Click Save & New to create the Date field and to return to the first step of the wizard. 2. Create the Miles field. a) For Data Type, select Number, click Next, and enter the following values: Field Label: Miles Length: 4 Decimal Places: 0 Field Name: Miles Description: Miles driven Check the Required checkbox b) Leave the defaults for the remaining fields and click Next. c) In the next step, accept the defaults and click Next. d) In the next step, click Save & New to create the Miles field and to return to the first step of the wizard. 3. Create the Contact field. a) For Data Type, select Lookup Relationship and click Next. The Lookup Relationship data type lets you link two data objectsin this case, the Mileage object and the Contact object. b) In the Related To dropdown list, select Contact, click Next, and enter the following values: Field Label: Contact Field Name: Contact Description: Person that was seen on this trip c) Leave the defaults for the remaining fields and click Next. d) In the next step, accept the defaults and click Next. e) Repeat two more times. f) Click Save to create the Contact field and to return to the Custom Object page.

Step 3: Create a tab


To create a user interface for the Mileage custom object, you need to add a custom tab to the standard tabs in the Salesforce application. When users click this tab, theyll be able to create, view, and edit Mileage records. 1. On the Personal Setup page, click App Setup > Create > Tabs. 2. Click New to launch the New Custom Tab wizard. 3. From the Object picklist, select Mileage.

http://developer.force.com

4. From the Tab Style options, select Car.

5. Accept the remaining defaults and click Next. 6. Click Next in the next two pages to complete the creation of the tab. As soon as you create the tab, you can see the new tab included in the set of tabs.

Step 4: Create an application


You now have three fields and a tab. By combining these objects, you can create an application that also includes other Force.com components such as dashboards and reports. 1. Navigate to App Setup > Create > Apps. 2. Click New to launch the New Apps wizard and enter the following values: Label: Mileage Tracker Description: This application tracks mileage records 3. Click Next. 4. Accept the defaults on the next page for the image source and click Next. 5. In the Available Tabs list box, locate the Mileages tab and click Add (Right Arrow) to add it to the box of selected tabs. 6. Repeat for the Contact tab and click Next. 7. In the heading of the Profile list, check the Visible checkbox to make the application available to all user profiles. 8. Click Save to create the Mileage Tracker application. As soon as you create the application, it appears in the Application dropdown list in the upper right of the screen, ready for action.

http://developer.force.com

Step 5: Test the application


Now check to see how your newly created application works. 1. Select the Mileage Tracker application from the Application dropdown list. 2. Click the Mileages tab and then click New to create a new mileage record. 3. Enter some test data, but dont enter more than 500 miles for any single record because you will create logic to limit daily mileage to 500 in Tutorial 3. For the Contact field, enter Tim Barr. 4. Click Save to save your record and to return to the detail page for the newly created record.

Step 6: Set up auto-numbering for your records


When you create new records in this application, you enter a name for each record to identify it. However, to make life easier and to make sure each record has a unique identifier, Salesforce can automatically assign record numbers. In this step, youll set up this functionality. 1. Click the Setup link at the top of the page. 2. Click App Setup > Create > Objects. 3. Click the Mileage custom object. 4. Click Standard Fields, locate the Mileage Name, and click Edit. 5. Change the Data Type to Auto Number. 6. For Display Format, enter MR-{0000}. 7. For Starting Number, enter 1. 8. Click Save to save your changes.

Summary
Congratulations, you have just built an applicationwithout any coding. By using the Force.com Builder, you simply followed the steps in each wizard to create an object, fields, and a tab, and then pulled it all together into an application that lets users create mileage records to track their business trips.

http://developer.force.com

S-ar putea să vă placă și