---
schema_version: "1"
id: 1f7044b9d71cd0809041a5880d8cc56162110f14c24d1afc1361ae41253b7877
title: Visit
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/sforce_api_objects_visits.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/sforce_api_objects_visits.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: be163a2a3a909257d1f9ed8bea937c82c0114a804630f48fbbb88321ea8503ae
description: Track information related to a field rep’s visit to a retail store where they perform retail activities. This object is available in API version 47.0 and later.
---
# Visit

Track information related to a field rep’s visit to a retail store where they perform retail activities. This object is available in API version 47.0 and later.

## Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), undelete(), update(), upsert()

## Fields

### AccountId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The account that is associated with a visit. This field is available in API versions 48.0 and later.

### ActualVisitEndTime

- **Type**: dateTime
- **Properties**: Create, Filter, Nillable, Sort
- **Description**: The date and time when the visit ended.

### ActualVisitStartTime

- **Type**: dateTime
- **Properties**: Create, Filter, Nillable, Sort
- **Description**: The date and time when the visit started.

### AddressId

- **Type**: reference
- **Properties**: Filter, Group, Nillable, Sort
- **Description**: The address of the retail store where the visit must be conducted. This field is available in API versions 52.0 and later. Not applicable for the enhanced model of Consumer Goods cloud.
    
    This is a relationship field.
- **Relationship Name**: Address
- **Relationship Type**: Lookup
- **Refers To**: Address

### cgcloud\_\_Account\_City\_\_c

- **Type**: string
- **Properties**: Filter, Nillable, Sort
- **Description**: City of the related account. This is a calculated field.

### cgcloud\_\_Account\_Street\_\_c

- **Type**: string
- **Properties**: Filter, Nillable, Sort
- **Description**: Street name of the related account.

### cgcloud\_\_Accountable\_\_c

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The accountable user for this visit. System sets the initiator of the visit as the initial accountable user.

### cgcloud\_\_Completed\_Date\_\_c

- **Type**: date
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Date the visit was completed.

### cgcloud\_\_Creation\_Date\_and\_Time\_\_c

- **Type**: dateTime
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: Date and time the visit was created.

### cgcloud\_\_Creation\_Mode\_\_c

- **Type**: picklist
- **Properties**: Create, Defaulted on create, Filter, Group, Nillable, Sort, Update
- **Description**: Specifies the way the visit was created. Possible values are manually or automatic.
- **Default value**: manually

### cgcloud\_\_Date\_mock\_\_c

- **Type**: date
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Help/Mock field to visualize calendar in visual force page. Value of this field won't be saved in the database.

### cgcloud\_\_Distribution\_Rate\_All\_\_c

- **Type**: double
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: Distribution rate of all products. The system calculates and stores the 'Distribution Rate of All Products' (DRallP) as percentage value.

### cgcloud\_\_Distribution\_Issue\_\_c

- **Type**: double
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: This is a KPI Field calculated based on the distribution rate of all products. The system caluclates and stores the 'Distribution Issues' (DI) as boolean value.

### cgcloud\_\_Duration\_Effective\_\_c

- **Type**: double
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: Effective visit duration captured via time tracking. Only implemented in mobile, will remain empty if visit is completed on desktop.

### cgcloud\_\_Duration\_In\_Minutes\_\_c

- **Type**: double
- **Properties**: Filter, Nillable, Sort
- **Description**: Planned duration of the visit (difference between planned start and end data). This is a calculated field.

### cgcloud\_\_End\_Date\_\_c

- **Type**: date
- **Properties**: Filter, Group, Nillable, Sort
- **Description**: Planned end date of the visit.

### cgcloud\_\_Fixed\_Visit\_Date\_\_c

- **Type**: picklist
- **Properties**: Create, Defaulted on create, Filter, Group, Nillable, Sort, Update
- **Description**: Specifies that this visit was scheduled with the customer at a fixed date and time. Attribute can be used to implement a logic which will not allow to move the visit to a different date or time. Possible values are 0 (No) and 1 (Yes).
- **Default value**: 0

### cgcloud\_\_Geolocation\_\_c

- **Type**: location
- **Properties**: Nillable
- **Description**: User’s geo coordinates (Latitude and Longitude) captured using their mobile device during the visit completion or cancellation.

### cgcloud\_\_IsAllDayEvent\_\_c

- **Type**: boolean
- **Properties**: Create, Defaulted on create, Filter, Group, Sort, Update
- **Description**: Visit is planned for the entire day. Weekly calendar visualizes such visits in the header of the day.
- **Default value**: false

### cgcloud\_\_Is\_Vst\_Cmpl\_Osid\_Range\_\_c

- **Type**: boolean
- **Properties**: Create, Defaulted on create, Filter, Group, Sort, Update
- **Description**: Indicates whether the visit completed outside the allowed distance between the GPS location and the store’s geolocation.
- **Default value**: false

### cgcloud\_\_Is\_Vst\_Start\_Osid\_Range\_\_c

- **Type**: boolean
- **Properties**: Create, Defaulted on create, Filter, Group, Sort, Update
- **Description**: Indicates whether the visit started outside the allowed distance between the GPS location and the store’s geolocation.
- **Default value**: false

### cgcloud\_\_Note\_\_c

- **Type**: textarea
- **Properties**: Create, Nillable, Update
- **Description**: Visit notes which can be captured to prepare the visit or during execution time.

### cgcloud\_\_Reason\_Code\_\_c

- **Type**: picklist
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Specifies the reason for visit cancellation.
- **Possible values**:
    - Unserviced—End of day reached
    - NoManager—Manager unavailable
    - StoreClosed—Store Closed
    - TimeWindow—Time window missed

### cgcloud\_\_Responsible\_\_c

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Responsible user for this visit.

### cgcloud\_\_Start\_Date\_\_c

- **Type**: date
- **Properties**: Filter, Group, Nillable, Sort
- **Description**: Planned start date of the visit.

### cgcloud\_\_Start\_Geolocation\_\_c

- **Type**: Geolocation
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Customer’s location coordinates (latitude and longitude) at the start of a visit.

### cgcloud\_\_Subject\_\_c

- **Type**: textarea
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Subject of the visit.

### cgcloud\_\_Subject\_Formula\_\_c

- **Type**: string
- **Properties**: Filter, Nillable, Sort
- **Description**: This field is required when subject needs to be displayed in a formula format. This is a calculated field.

### cgcloud\_\_Visit\_Planned\_Date\_\_c

- **Type**: date
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Planned date for the visit.

### cgcloud\_\_Visit\_Template\_\_c

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Template of the visit. This field is a relationship field.

### ContactId

- **Type**: reference
- **Properties**: Filter, Group, Nillable, Sort
- **Description**: The person to contact at the retail store during a visit. This field is available in API versions 52.0 and later. Not applicable for the enhanced model of Consumer Goods cloud.
    
    This is a relationship field.
- **Relationship Name**: Contact
- **Relationship Type**: Lookup
- **Refers To**: Contact

### ContextId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The purpose of a visit, such as claim, business license application, or work type. This field is available in API versions 48.0 and later. Not applicable for the enhanced model of Consumer Goods cloud.

### CreatedById

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: User who created the visit.

### CreatedDate

- **Type**: date
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Date the visit was created.

### InstructionDescription

- **Type**: textarea
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: Special instructions provided by a sales manager or an admin that a sales rep refers to during a visit. Not applicable for the enhanced model of Consumer Goods cloud.

### LastModifiedById

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: User who last modified the visit.

### LastModifiedDate

- **Type**: date
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Date and time of the last modification for this visit.

### LastReferencedDate

- **Type**: dateTime
- **Properties**: Filter, Nillable, Sort
- **Description**: The most recent date on which a user referenced this record.

### LastViewedDate

- **Type**: dateTime
- **Properties**: Filter, Nillable, Sort
- **Description**: The most recent date on which a user viewed this record.

### LocationId

- **Type**: reference
- **Properties**: Filter, Group, Nillable, Sort
- **Description**: The location of the retail store where visit must be conducted. This field is available in API versions 52.0 and later.
    
    This is a relationship field.
- **Relationship Name**: Location
- **Relationship Type**: Lookup
- **Refers To**: Location

### Name

- **Type**: string
- **Properties**: Autonumber, Defaulted on create, Filter, idLookup, Sort
- **Description**: Unique identifier for the visit record.

### OwnerId

- **Type**: reference
- **Properties**: Create, Defaulted on create, Filter, Group, Sort, Update
- **Description**: ID of the visit record owner.

### PlaceId

- **Type**: reference
- **Properties**: Create, Filter, Group, Sort, Update
- **Description**: ID of the place that sales reps visit.

### PlannedVisitEndTime

- **Type**: dateTime
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: The date and time when the visit is expected to end.

### PlannedVisitStartTime

- **Type**: dateTime
- **Properties**: Create, Filter, Sort, Update
- **Description**: The date and time when the visit is expected to start.

### RetailStoreId

- **Type**: reference
- **Properties**: Filter, Group, Nillable, Sort
- **Description**: The retail store where the visit is conducted. This field is available in API versions 52.0 and later. Used in CG Cloud base model to assign a retail store. Not applicable for the enhanced model of Consumer Goods cloud.
    
    This is a relationship field.
- **Relationship Name**: RetailStore
- **Relationship Type**: Lookup
- **Refers To**: RetailStore

### Status

- **Type**: picklist
- **Properties**: Create, Defaulted on create, Filter, Group, Restricted picklist, Sort
- **Description**: The status of the visit. Sales reps’ can’t edit this field.
    
    ![Note](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/images/icon_note.png)
    
    #### Note
    
    This is a static picklist. The values of the picklist aren’t displayed in the Object Manager.
- **Default value**: Planned
- **Possible values**:
    - Abandoned
    - Completed
    - InProgress
    - Planned
    - Unscheduled
    - None
    - Error

### StatusRemarks

- **Type**: textarea
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: The reasons for abandoning or completing the visit as provided by the sales rep. Not applicable for the enhanced model of Consumer Goods cloud.

### VisitPriority

- **Type**: picklist
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The priority of the visit.
    
    Not applicable for the enhanced model of Consumer Goods cloud.
- **Possible values**:
    - High
    - Low
    - Medium

### VisitorId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: ID of the sales representative visiting the store. Not applicable for the enhanced model of Consumer Goods cloud.

## Associated Objects

This object has the following associated objects. Unless noted, they are available in the same API version as this object.

- **[VisitShare](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/sforce_api_associated_objects_share.htm "StandardObjectNameShare is the model for all share objects associated with standard objects. These objects represent a sharing entry on the standard object.")**: Sharing is available for the object.
- **[VisitFeed](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/sforce_api_associated_objects_feed.htm "StandardObjectNameFeed is the model for all feed objects associated with standard objects. These objects represent the posts and feed-tracked changes of a standard object.")**: Feed is available for the object.
- **[VisitHistory](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/sforce_api_associated_objects_history.htm "StandardObjectNameHistory is the model for all history objects associated with standard objects. These objects represent the history of changes to the values in the fields of a standard object.")**: History is available for the object.
- **[VisitOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/sforce_api_associated_objects_history.htm "StandardObjectNameHistory is the model for all history objects associated with standard objects. These objects represent the history of changes to the values in the fields of a standard object.")**: Sharing rule is available for the object.