Update a Salesforce Record and its Related Lists

Learning Objectives

After completing this tutorial, you will be able to:

  • Create a Custom Lookup Field from the Contact Object to the Form Object
  • Add Linked Sections to a Form Template that leverages fields on Contact Object
  • Create and store multiple Contact Records from the same Form

Prerequisites: Build Your First Form TemplateField LinksBranching Logic & Allow New Records


Linked Sections

Linked Sections can be used to store repeating information when it may be unclear how much data needs to be created from a form. For example, multiple family members need to be captured on a financial intake form, multiple patient medications on a patient health assessment, multiple contacts on an account, etc.

In the Arabica Coffee Store Visit Scenario, we have already created a Store Contact Information section to capture details about the Monroe Markets Account and the Store Manager, Peter Parker. But what happens if the store visit rep encounters new contacts during a visit–perhaps an assistant manager or a director of operations whose information would be worthwhile to capture inside of Salesforce? How would the rep be able to add them directly from the store visit form?

This is easy to accomplish using a Linked Section. This feature would allow the store visit rep to collect extra contacts if necessary, or collect more in-depth data like inventory data for all Arabica’s products in the store which we will demonstrate in the next tutorial. Let’s start by showcasing a Contact Linked Section. Since each Linked Section needs to link to an existing object in Salesforce, we’ll start with some basic configuration. Begin by logging in to your Salesforce Org where you’ve been completing the tutorials up to this point.


Create a Custom Lookup Relationship from the Contact Object to the Form Object

  1. Start by accessing the Contact Object by navigating to the Contact object field list.
    • In classic: Setup > Build > Customize > Contacts > Fields.
    • In LEX: Setup > Object Manager > Contact > Fields & Relationships
  2. Add a new field.
    • In Classic: On the Contact Fields page, scroll down to Contact Custom Fields and Relationships and select New.Custom Fields and Relationships.jpg
    • In LEX: On the contact Fields & Relationships page, click New.
  3. In Step 1, select Lookup Relationship as the Data Type and then click Next:Custom Field Step 1.jpg
  4. In Step 2, select Form from the Related To picklist menu and then click Next.Custom Field Step 2.jpg
  5. In Step 3, set the Field Label and Field Name both to Form, leaving all other fields as the default and then click Next.Custom Field Step 3.jpg
  6. In Step 4, review your Field Level Security preferences and then click Next.Custom Field Step 4.jpg
  7. In Step 5, confirm your Page Layout references and then click Next.Custom Field Step 5.jpg
  8. Finally, in Step 6, confirm all settings and then Save your new custom lookup relationship.Custom Field Step 6.jpg
    **Note: This action of creating a lookup relationship on the Contact Object to the Form Object is the necessary first step for creating any Linked Section. Whichever object you’re attempting to create a Linked Section from needs to have the same lookup to the form object. This is true for Leads, Opportunities, or even Custom Objects as we’ll demonstrate in the next tutorial.

Add a Linked Section to Your Form Template

  1. Click the Form Templates tab from the navigation bar and select template Arabica Coffee Store Visit. From the Form Template Detail Page, either delete the associated forms you have in the forms list or select the gear menu to Copy for a New Version.
  2. Click Edit to make changes to your template:

  3. Drag and Drop a Linked Section into the template builder directly below the Store Contact Information Section. If Linked Section is not one of the visible buttons, check the Show Smart Features checkbox.

  4. In the Linked Section Edit box, enter the following information:
    1. Name the section Contact Information with one column
    2. Set the Link Section Object to Contact with the Link Section Object Lookup set to Form__C
    3. Select the Linked Section Icon tab. choose a Linked Section Icon Color, then choose your Linked Section Icon.
    4. Click Save
  5. Drag and drop a question into your new Contact Information section. Notice that the question type will automatically be set to Field Link. Set the Question Text to First Name and choose the First Name Field Link Field and then click Save.
  6. Repeat step 13 for the following questions as well, noting the Question Text and Field Link Field. All other options should remain default.
    Question Text Field Link Field
    Last Name Last Name
    Title Title
    Phone Number Business Phone
    Email Address Email
  7. From the template builder screen, choose which questions should display in the linked section compact view by clicking the icons on the right. Grayed out icons indicate questions that will only be visible on the expanded view. Note: Not all question types are available to be included in the compact view.
  8. Save the changes and close out of the Template Builder.

Create a New Form

  1. From the Form Template Detail page, Create a New Form from using mock data from your instance. We will demonstrate with the Monroe Markets Account record and Peter Parker’s contact record and Complete the New Form.

    New Form Wizard.jpg

  2. Within the form, you’ll see that some data has already been populated including Monroe Markets account information and Peter Parker’s first and last name. Set Peter Parker’s preferred contact method to Phone and notice that his Phone Number prepopulates as well.Monroe Markets Store Info.jpg
  3. Move on to the next section, your newly created Contact Information Linked Section. From this section, the Store Visit rep would be able to document any new contacts they encounter in-store that they deem important to the Monroe Markets account. The benefit of this functionality is that there is no limit to the number of contacts the rep can create from these linked sections. Add a new linked section by clicking the Add + button.
  4. Add a new contact into the Contact Information section to test the functionality. When completed click Done. To cancel this action and exit the screen without adding a contact, click the trashcan icon in the upper-right corner.
  5. In this case we will only create one contact, but if the user were to want to create more contacts, they would simply select the Add + button.Bruce Wayne Contact.jpg
  6. After entering your mock data, you can see the compact view of the contact you created. To edit, you can click on the contact to open the expanded view again.
  7. When you’re done, click Save at the top of the form to save your data and exit the form.
  8. From the Form Detail page, search for your newly created contact from the Salesforce search bar in the top left-hand portion of your screen:Search Bruce Wayne.jpg
  9. You’ll see that the new contact has been created in Salesforce. It’s not yet related to the Monroe Markets account, but we’ll demonstrate how to do this with Shared Linked Sections in the next tutorial.Search Contact.jpg

You’ve now created a simple Linked Section. Learn how to leverage Custom Objects with Linked Sections and how to Share Linked Section data with the Monroe Markets Account in our Shared Linked Section Tutorial.

We use cookies to ensure that we give you the best experience on our website.
If you continue to use this site we will assume that you are happy with it.