Skip to main content

Add Custom Fields

By default, your custom object has some standard fields on it. You need to add more fields to store relevant information about each suggestion. Fields can store many types of data. Feel free to explore these later as you extend your app. For now, let’s add a few that we know we need.

  1. Click the gear icon Setupand select Setup. This launches Setup in a new tab.
  2. Click the Object Manager tab.
  3. From the list of objects, click Suggestion.
  4. Click the Fields & Relationships section.
  5. Click New.

Add a Description Field

This field is used by employees when they explain their suggestion.

  1. For Data Type, select Text Area (Long), and click Next.
  2. Fill in the custom field details:
    1. Field Label: Suggestion Description
    2. Length: 32,768
    3. Visible Lines: 10
    4. Field Name: Suggestion_Description
    5. Help Text: Please enter as much detail around this suggestion so we clearly understand your idea.
    6. Leave all other options as the default.
  1. Click Next.
  2. Click Next again.
  3. Click Save & New.

Add a Category Field

This field helps us categorize each suggestion. It also makes it easier for us to report on what types of suggestions we get the most.

  1. For Data Type, select Picklist, and click Next.
  2. Fill in the custom field details:
    1. Field Label: Suggestion Category
    2. Field Name: Suggestion_Category
    3. Select the radio button Enter values, with each value separated by a new line.
    4. Enter the following values for the picklist (one per line):
      • Customer Service
      • Employee Services
      • Facilities/ IT
      • Kitchen Snacks
      • Other
  1. Deselect Restrict picklist to the values defined in the value set.
  2. Click Next.
  3. Click Next again.
  4. Click Save.

Try Out the App

  1. Click the app launcherApp Launcher.
  2. Select Suggestion Box.
  3. Click the Suggestions tab, and click New.
    Note: You should see that your two custom fields were added to the Suggestion page.
  4. Fill in a sample suggestion and click Save.

Viewing Objects in Schema Builder

Schema Builder provides a dynamic environment to add new custom objects, custom fields, and relationships to your Salesforce database. It also eliminates the need to click from page to page to add a new custom field to an object or to find the details of a relationship.

Screenshot of the Schema Builder

Let’s take a look at the Suggestion custom object in the Schema Builder.

  1. Click Setupand select Setup. This launches Setup in a new tab. From Setup, enter Schema Builder in Quick Find, then select Schema Builder.
  2. From the Objects Palette, click Clear All and then select the Suggestion object and the User object.
  3. If you don’t see your objects in the Canvas area, click Auto-Layout and drag them around until you like how they are arranged.

Let’s add more fields so that you can track the progress of a Suggestion.

Add a Status Field

This field helps track the status of the suggestion. It is also a way for the suggestor to know what is going on with their suggestion.

This field will have unique security protocols in that only admins can change the status.

  1. Click the Elements tab. This displays all of the new things you can add to your database schema: objects and fields.
  2. Drag the Picklist field type and drop it on the Suggestions object.
  3. Fill in the custom field details:
    1. Field Label: Status
    2. Field Name: Status
    3. Values: (one per line)
      • New
      • Under Consideration
      • In Progress
      • Implemented
  1. Select Use first value as default value.
  2. Click Save.

You should see the Status field at the top of the list of fields in the Suggestion object’s box in the schema diagram.

Next, you update the Status field’s security.

  • While still in the Schema Builder, right-click the Status field that you just added to the Suggestion object. Click Manage Field Permissions.
  • Select Read-Only checkbox at the top of the column to make this field read only for all users.
  • In the Read-Only column, deselect System Administrator then click Save.

Add a Date Field

This field helps track when the Suggestion was Implemented. It’s also important because we reference this field in the formula field we create in a later exercise.

This field will have unique security protocols in that only admins can change the date.

  1. Drag the Date field type and drop it on the Suggestions object.
  2. Fill in the custom field details:
    1. Field Label: Implemented Date
    2. Field Name: Implemented_Date
    3. Leave the defaults for the remaining fields.
    4. Click Save.
      Note: You should see the Implemented Date field at the top of the list of fields in the Suggestion object’s box in the schema diagram.

Next, you update the Implemented Date field’s security.  

  1. While still in the Schema Builder, right-click the Implemented Date field that you just added to the Suggestion object. Click Manage Field Permissions.
  2. At the top of the column, select Read-Only to make this field read only for all users.
  3. In the Read-Only column, deselect System Administrator, then click Save.

Try Out the App

Go back to the Suggestions tab in the browser and create a new Suggestion record.

Notice anything? Where are our two new fields we just created, Status and Implemented Date?

Don’t worry, they are there, just not on the page layout. When you use the Field Wizard, you have the option to add the field to the page layout automatically. When you use the Schema Builder, you need to add the field using the Page Layout Editor. In the next exercise, we do that, and make some other modifications to the user experience to make the app easier to use.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback