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.
| Available in: Lightning Experience |
| Available in: Enterprise and Unlimited Editions that have Consumer Goods Cloud enabled |
| User Permissions Needed | |
|---|---|
| To delete visits: |
CGCloud Business Admin OR CGCloud Retail Business Admin |
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.
- In Setup, find and select Custom Settings.
- Find System Setting, and then click the Manage link next to it.
- To add a setting, click New.
-
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.
- Enter True as the value for the setting.
- Save your changes.
- On System Setting, click New.
- Enter Age_of_Visit as the name of the new setting.
- In Value, enter the number of days after which a completed visit can be deleted.
- Save your changes.
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.