---
schema_version: "1"
id: 16761c92666ac6b6866cb6c9344f4ceb1efc50a0fa98fe9c18c8dcb3269e634d
title: Set Up Visit Window Selection for Specific Routable Object Records
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/salesforce_maps_adv_finetune_visitwindows_lookup.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.salesforce_maps_adv_finetune_visitwindows_lookup.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: fb0e226f2b7f69e9e7b53607feeab4b0727d9545fd66a426548166f524ba4e4b
description: Make it easy and intuitive for your reps to link a visit window to a customer by creating a lookup relationship and a menu option on the record page layout. If reps don't set visit windows at the record level, then Salesforce Maps Advanced uses the visit window in the visit plan when generating routes.
products:
  - Sales
  - Salesforce Maps
release: "264"
---
# Set Up Visit Window Selection for Specific Routable Object Records

Make it easy and intuitive for your reps to link a visit window to a customer by creating a lookup relationship and a menu option on the record page layout. If reps don't set visit windows at the record level, then Salesforce Maps Advanced uses the visit window in the visit plan when generating routes.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=sales.salesforce_maps_editions.htm&amp;release=264.0.0&amp;type=5" title="Identify supported Salesforce editions, user interfaces, and product areas.">View supported editions</a>.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d14173e60">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d14173e60 ">To customize settings:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d14173e60 ">Customize Application</td>

          </tr>
        </tbody>
      </table>

![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-salesforce_maps-264-0-0-production-enus/2addcda4-01f0-4f47-83c5-f499a45bf555/images/icon_tip.png)

Tip If the same visit window applies to more than one customer location, consider creating a shared visit window.

1. From Setup, in the Quick Find box, enter Object, and then select **Object Manager**.
2. Select the routable object that you want to link visit windows to. For example, the Account object.
3. Select **Fields & Relationships**, and then click **New**.
4. On the New Custom Field page, under Data Type, select **Lookup Relationship** and click **Next**.
5. From the Related To list, select **Maps Advanced Route Visit Windows** and click **Next**.
6. On the New Relationship page, specify the custom field label and field name, and then click **Next**.
7. Configure field-level security and other settings, and then save your work.
8. To create another lookup custom field for a customer location with more than one visit window, repeat steps 1 through 7. For example, if sales reps and merchandisers visit the same customer location at different times, use two lookup custom fields to represent each visit window.
    
    Next you create a custom menu option on the record page layout. Reps select this menu option to link a visit window to a customer location, such as an account.
    
    For example, on a franchise account record, the rep selects a custom menu option to specify a visit window for that franchise location (1).
    
    ![Custom menu option shown on an account record page.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-salesforce_maps-264-0-0-production-enus/2addcda4-01f0-4f47-83c5-f499a45bf555/salesforce_maps/images/salesforce_maps_adv_window_visits_3.png)
9. In Object Manager, for the same routable object as in step 1, select **Buttons, Links, and Actions**, and then click **New Button or Link**.
    
    ![Custom Button or Link Edit page showing the Set Multiday Visit Windows custom button specifications.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-salesforce_maps-264-0-0-production-enus/2addcda4-01f0-4f47-83c5-f499a45bf555/salesforce_maps/images/custombuttonlink.png)
10. For Display Type, select **Detail Page Button**.
11. For Behavior, select **Display in existing window without sidebar**.
12. For Content Source, select **URL**.
13. In the URL box, paste this code and then replace the bracketed text with the appropriate values.
    
    `/apex/maps__AdvRouteVisitWindow?id=[Routable Object Record Id]&field=[API Name of the Maps Advanced Route Visit Windows lookup field]`
    
    For example, your routable object is Retail Store, and the API name of your custom lookup field is Maps\_Advanced\_Route\_Visit\_Windows\_\_c. The code in the URL box is:
    
    ```
    /apex/maps__AdvRouteVisitWindow?id={!RetailStore.Id}&field=Salesforce_Maps_Visit_Window__c
    ```
14. Check your syntax and save your work.
15. Add your custom menu option, also known as a custom button, to your routable object record page layout. Then your reps can see and use it on a record detail page to add visit windows.

#### See Also

- [Create Shared Visit Windows for Individual Routable Object Records](https://help.salesforce.com/s/articleView?id=sales.salesforce_maps_adv_finetune_visitwindows.htm&release=264.0.0&type=5 "Help your sales reps save time and honor customers’ visit windows by creating shared visit windows for chains and franchises. For example, as a sales and service operations manager, you create windows in Salesforce Maps Advanced that restrict visits to begin and end during certain time frames. Your reps apply those visit windows to the accounts that they sell to and serve.")
- [_Salesforce Help_: Define Custom Buttons and Links](https://help.salesforce.com/s/articleView?id=platform.defining_custom_links.htm&type=5&language=en_US)
- [_Salesforce Help_: Page Layouts](https://help.salesforce.com/s/articleView?id=platform.customize_layout.htm&type=5&language=en_US)
- [Days Between Visits](https://help.salesforce.com/s/articleView?id=sales.salesforce_maps_advanced_concepts_minmaxdays.htm&release=264.0.0&type=5 "Learn how Salesforce Maps Advanced determines the dates for customer visits by using minimum and maximum days between visits.")