Salesforce scheduling buttons for Person Accounts

Salesforce scheduling buttons for Person Accounts provide quick access to Personalized links (Salesforce record ID). Bookings made via this link are automatically added to the Person Account record and the customer making the booking does not have to provide any information that already exists for this record.

Direct scheduling buttons can be used in two ways:

  • The Booking page link can be copied and sent to the customer
  • The Salesforce user can schedule on behalf of the customer

Direct scheduling buttons can be configured to prepopulate the booking form or skip it altogether. This is enabled by the Optional mapping step in the ScheduleOnce Salesforce setup wizard where you can define the mapping between record fields and booking form fields.

In this article, you will learn how to add the Schedule with Me button to the Person Account page layouts in Salesforce.

Requirements

To add the Schedule with Me button to the Person Account Page layouts in Salesforce, you will need:

Important: The Salesforce Lightning experience does not support OnClick Javascript buttons. If you are switching to the new Lightning experience, you can either invoke Apex classes in the process  builder, or add a javascript controller for the Lighning Design System. Learn more about using OnClick Javascript button with the Salesforce Lighning experience

 

Create the Contact lookup field

First, we will add a Lookup custom field to the Person Account record.

  1. Log in to Salesforce.
  2. In your Salesforce Setup page, go to App Setup > Customize.
  3. Select the Account object and then Fields.
  4. Click New, select Lookup Relationship and Next.
  5. In the Related to drop-down, select Contact and Next.
  6. In the Step 3. You will enter the label and name for the lookup field:
    • Label: Contact
    • Name: Contact_ID
  7. Follow the steps and add the lookup field to the Person Accounts Page layouts.

Create Custom buttons in Salesforce

Now you can create the button to add to the Person Accounts page layout. The button will retrieve the Contact ID from the Custom Contact lookup field. When clicked, you will be able to make a booking on behalf of the Contact added to that Person Account.

To create a button field to the Person Account Page layout:

  1. In your Salesforce Setup page, go to App Setup > Customize.
  2. Select the Account object and then Buttons, Links, and Actions.
  3. Enter the following information (see Figure 1):
    • Label: Schedule with Me
    • Name: Schedule_with_me
    • Description: This button allows you to schedule meetings on behalf of the Contact related to this Person Account record.
    • Display Type: Detail Page Button 
    • Behavior: Execute Javascript
    • Content Source: OnClick Javascript
  4. In the Code below, first replace the red text by your Booking page and insert the Contact lookup field API name that you have created previously. Once completed, copy and paste the updated code in the Code box.
  5. Paste the updated code in the Code box:
    window.open("your booking page link&Skip=1&sfLeadId={!Lead.Id}&sfContactId={!<your_lookup_field_API_name>}&sfCaseId={!Case.Id}", "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=200, left=200, width=900, height=600")
  6. Click Save.

    Figure 1: Button on the Person Account page layout

Add the Schedule with Me button to Person Account Page layouts

Now you just need to add the button to the Salesforce Person Account Page layouts.

Note: Page layouts control which buttons are visible. If you want to display the buttons only to specific Salesforce Users, you can assign your Page layouts to specific Users. Learn more

  1. In your Salesforce Setup page, go to App Setup > Customize.
  2. From the Account > Person Accounts, select Page Layout.
  3. On the Page Layout page, select Buttons.
  4. Click and drag the Schedule with Me button to the Custom buttons area.
  5. When you have completed your edits, click the Save button.

Learn more about our integration with Salesforce:

Rate this article