Salesforce scheduling buttons for Opportunities

Salesforce scheduling buttons provide a quick method to schedule on behalf of a Customer. A schedule button on the Opportunity record allows quick scheduling with the Opportunity’s related Contact record. Bookings made via these buttons are automatically added to the Salesforce record that the booking is scheduled from. 

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

Figure 1: Schedule with related Contact button

In this article, you'll learn how to add the Schedule with related Contact button to the Opportunity record Page Layouts in Salesforce.


To add the Schedule with related Contact button to the Opportunity Page layouts in Salesforce, you will need:

Creating a Contact Lookup field

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

  1. Sign in to Salesforce as your API User.
  2. Go to the Setup page. 
  3. In the Platform Tools section, go to Objects and Fields -> Object Manager (Figure 2).
    Figure 2: Object Manager in the Objects and Fields menu
  4. In the Object Manager list, select the Opportunity object (Figure 3).
    Figure 3: Opportunity in the Object Manager list
  5. Select Field & Relationships -> New (Figure 4).
    Figure 4: Fields & Relationships
  6. In the New Custom Field pane, select Lookup Relationship and Next (Figure 5).
    Figure 5: New Custom Field—Step 1
  7. In the Related to drop-down menu, select Contact
  8. Click Next.
  9. Enter a label and name for the Lookup field, then click Next (Figure 6).
    • Field Label: Contact
    • Field Name: Contact_ID
      Figure 6: New Relationship
  10. In Step 4 and Step 5, click Next
  11. In Step 6, click Save.

Creating a button in Salesforce

Now you can create the button to add to the Opportunity 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 Opportunity.

Note You can also follow the steps below for Custom objects. In this case, the button and the custom Lookup field should be added to a Custom object instead of the Opportunity Page Layout.

  1. Go to the Setup page.
  2. In the Platform Tools section, go to Objects and Fields -> Object Manager.
  3. Select the Opportunity object. 
  4. Select Buttons, Links, and Actions -> New Button or Link (Figure 7).
    Figure 7: New Button or Link
  5. In the New Button or Link pane, enter the following information:
    • Label: Schedule with related Contact
    • Name: Schedule_with_related_Contact
    • Description: This button allows you to schedule meetings on behalf of the Contact related to this Opportunity record.
    • Display Type: Detail Page Button 
    • Behavior: Display in new window
    • Content Source: URL
  6. Copy the following link and paste it in the large text box (Figure 8).{!Lead.Id}&sfContactId={!Opportunity.Contact_IDid__c}&sfCaseId={!Case.Id}

    Figure 8: Paste link in the large text box

  7. Replace the placeholder URL (Figure 9) with the Public link of the Booking page or Master page that you want to use for the new button. You can find the Public link in the Booking page Overview section or Master page Overview section.
    Figure 9: Placeholder URL text For example, if you want to create a button for a Booking page with the Public link, your finished link would be:{!Lead.Id}&sosfContactId={!Opportunity.Contact_IDid__c}&sosfCaseId={!Case.Id}

  8. Click Save.

Adding a button to Salesforce Page Layouts

The next step is to add the new button you've created to the relevant Salesforce Opportunity Page Layouts.

NotePage 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 about assigning Page Layouts to Profiles

  1. In Opportunities, click Page Layouts and then select the Layout you want to add a button to (Figure 10).
    Figure 10: Page Layouts
  2. In the Opportunity Layout editor, select Mobile & Lightning Actions (Figure 11).
    Figure 11: Mobile & Lightning Actions
  3. Click and drag the Schedule with related Contact button to the Salesforce Mobile and Lightning Experience Actions section (Figure 12).
    Figure 12:  Add button to Salesforce Mobile and Lightning Experience Actions section
  4. Click Save.

You're all set! Your button is now ready to use on your Opportunity pages.

Was this article helpful?
Thank you for your feedback!