---
schema_version: "1"
id: 231f987579a33d66c6a9310ab767283898d27f5f8dcd049af0c16c2724a3543e
title: Create Custom System Settings for the Deletion of Retail Visit
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/cg_admin_create_visit_deletion_custom_settings.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.cg_admin_create_visit_deletion_custom_settings.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d98baa2e611a65e2abb4034a533fe210efd966b1c621f31dd14d1199236db696
description: Use custom system settings to enable the deletion of completed visits on the Consumer Goods Cloud desktop app. The app restricts the deletion of completed visits, but with these settings in place, you can delete a completed visit by using the Delete option for a visit on the desktop app or through the API.
products:
  - Consumer Goods
release: "264"
---
# Create Custom System Settings for the Deletion of Retail Visit

Use custom system settings to enable the deletion of completed visits on the Consumer Goods Cloud desktop app. The app restricts the deletion of completed visits, but with these settings in place, you can delete a completed visit by using the Delete option for a visit on the desktop app or through the API.

### Required Editions

To delete visits, you must have the Industries Visit permission set license.

<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;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong> and <strong>Unlimited</strong> Editions that have Consumer Goods Cloud enabled</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="d85634e48">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d85634e48 ">To delete visits:</td>
            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d85634e48 ">
              <p>CGCloud Business Admin</p>
              <p style="margin-bottom:0;">OR</p>
              <p style="margin-bottom:0;">CGCloud Retail Business Admin</p>
            </td>
          </tr>
        </tbody>
      </table>

You can delete a completed visit only if these conditions are met:

- The value in the Age\_of\_Visit setting is less than the difference between the visit completion date and the current date.
- The value in the Delete\_Completed\_Visit setting is True.
- You have access to the visit.

1. In Setup, find and select **Custom Settings**.
2. Find System Setting, and then click the **Manage** link next to it.
3. To add a setting, click **New**.
4. Enter Delete\_Completed\_Visit as the name of the new setting.
    
    The Delete\_Completed\_Visit custom setting doesn’t consider the Delete Allowed flag on the visit template and deletes a completed visit regardless of the flag status.
5. Enter True as the value for the setting.
6. Save your changes.
7. On System Setting, click **New**.
8. Enter Age\_of\_Visit as the name of the new setting.
9. In Value, enter the number of days after which a completed visit can be deleted.
10. Save your changes.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-consumer_goods_retail_admin-264-0-0-production-enus/5bb7d7f5-119d-42d0-8596-95e762837019/images/icon_example.png)

Example To delete completed visits that were in the app for over a year, update the value in the Age\_of\_Visit setting to 365 days and set the Delete\_Completed\_Visit value to True to make sure that only the visits completed more than a year ago are considered for deletion. This configuration enables the deletion of visits that meet the age criteria.