Set Up Visit and Inventory Access

Set up the right object permissions so that users access just the visits and inventories they’re responsible for. You can use Sharing Settings and custom Apex triggers to set up access.

Required Editions

Available in: Lightning Experience

Available in: Enterprise and Unlimited Editions with Health Cloud or Life Sciences Cloud

User Permissions Needed
To set default sharing access: Manage Sharing
To edit object permissions:

Manage Profiles and Permission Sets

AND

Customize Application

Before you set up view permissions, it’s a good idea to create different profiles for the different business functions at your organization.

Here’s how you configure object permissions related to visits and product inventories for a sales rep.

  1. From Setup, enter Sharing Settings in the Quick Find box and select Sharing Settings.
  2. Click Edit for Organization-Wide Defaults.
  3. Set Product Fulfillment Location, Product Item, and Visit to Private.
  4. Save your changes.
  5. Enter Profiles in the Quick Find box and select Profiles.
  6. Click the profile you set up for your sales reps.
  7. Click Edit and go to the Standard Object Permissions section.
  8. Select Read, Create, Edit, and Delete for Visits, Product Items, and Product Fulfillment Locations.
  9. Deselect View All Records for Visits, Product Items, and Product Fulfillment Locations.
  10. Save your changes.

Now, you can implement appropriate Apex Classes and Triggers in your org to control how visit and inventory access is shared with your users. You can write these classes and triggers in any way that best suits the needs of your organization. In this article, we've provided some sample Apex classes and triggers to help you get started.

  • Sample Apex Trigger for Visit and Inventory Access
    Implement appropriate Apex Classes and Triggers in your org to control how visit and inventory access is shared with your users. You can write these classes and triggers in any way that best suits your organization's requirements. Here are some sample Apex classes and triggers to help you get started. The Visit trigger provides sharing access to the Visit object and related objects at the time a visit is created or updated. The Visitor trigger provides access to the user who is assigned to a visit. You can use these Apex triggers with profile-based permissions and organization-wide sharing settings to make sure that users access just their visits and inventories.