Home > DeveloperSection > Articles > SFDC: Add field to an Object

SFDC: Add field to an Object


Sales Force Cloud Computing  Cloud Development  SFDC  DEV-401 
Ratings:
0 Comment(s)
 1207  View(s)
Rate this:

SFDC: Add field to an Object

 

In my previous post SFDC: Create an App and Database, we created a cloud app for managing merchandise in a warehouse. Behind the scenes, the platform created a database for the app. This post let you continue building the database for your app.

·         A database organizes and manages data so that users can work with it efficiently. Traditional relational databases use tables to manage discrete, possibly related, collections of information, organized further into datatype-specific columns (attributes) and rows (records). In Salesforce, you refer to these as objects.

·         Your DE org comes with many standard objects (for example, Accounts, Products, and Tasks) that support pre-built apps.

·         Any new objects you create are called custom objects. The Merchandise object is one such custom object.

·         Here add two new custom fields (Price and Inventory) to supplement the standard fields the object already has (Name, Owner, CreatedBy, LastModifiedBy).

 

Add the Price Field to the Merchandise Object

A merchandise object should have fields that are used for tracking various information, such as how much individual units cost and how many units are in stock. You can add custom fields to list or track just about anything you can think of.

1.       From Setup, click Create > Objects.

2.       Click Merchandise, scroll down to Custom Fields and Relationships, and click New.

3.       The New Custom Field Wizard helps you quickly specify everything about a new field, including its name, labels to use for app pages, help information, and visibility and security settings. Create the Price field as follows:

a.       For Data Type, select Currency, and click Next.

b.      Fill in the custom field details:

                                                               i.      Field Label: Price

                                                             ii.      Length: 16

                                                            iii.      Decimal Places: 2

                                                           iv.      Select the Required checkbox

c.       Leave the defaults for the remaining fields, and click Next.

d.      Click Next again to accept the default field visibility and security settings.

e.      Click Save & New to save the Price field and to return to the first step of the wizard.

 

 

Add the Quantity Field to the Merchandise Object

1.       For Data Type, select Number and click Next.

2.       Fill in the field details:

                                                               i.      Field Label: Quantity

                                                             ii.      Select Required

4.       Leave the defaults for the remaining fields, and click Next and Next again.

5.       Click Save.