xMatix
Sign in Request demo
xMatix
PRODUCTS
SalesField SalesCRMRewardsClaimsInventoryProcurementWarehouse ManagementField ServiceServiceSupportTelephony & MessagingFinance & AccountingPayrollExpense ManagementCommercePortalsAnalytics & ReportingData StudioMobile AppSee all products →
PLATFORM
Platform overviewApp BuilderAutomationIntegrationsSecurity & GovernanceChange ManagementDevelopers
SENSE AI
Sense AI overviewSense AssistSense ControlSense VisionAI StudioTrust & governanceIn Claude & ChatGPTUse cases
SOLUTIONS
FMCG & DistributionManufacturing & Dealer NetworksAutomotive & DealershipsPharma & HealthcareConsumer DurablesAgri-InputsBuilding MaterialsService NetworksWarehousing & 3PLFinancial AccountingERP SoftwareIndia GST ComplianceUAE VAT & e-InvoicingSaudi ZATCA & VATAll solutions →
RESOURCES
Knowledge CenterDeveloper & CLIBlogGuidesWhat is xMatix?Company facts
COMPANY
AboutCareersPartnersEventsContactAuthorsLegal
Sign in Request demo
Home/Docs/Entity Reference/Visit — entity reference
REFERENCE · Last reviewed

Visit — entity reference

One stop a field rep executes: a dated call on an outlet (accountId), normally generated under a VisitPlan from the route's stops (visitRouteStopId links back), from an account group's members, or from pending delivery orders. Lifecycle runs through visitStatus (Planned, Assigned, Started, Paused, Completed, Cancelled, Rescheduled); entering Started stamps the actual start (documentDate + startTime, kept on resume from Paused), Completed stamps endTime, and only the resource the plan is assigned to may move a visit into an execution state (VisitAssignmentGuard). Execution work hangs off child VisitTask rows (materialized from the visit's visitTaskTemplateId), and business documents created during the visit link back: the first Order/ServiceOrder created against the visit is stamped as its canonical orderId/serviceOrderId (never overwritten; later documents stay children via their own visitId). Also carries deliveryOrderId, invoiceId, paymentId and productDemoId links, the captured GPS point (visitLocation) versus the planned point (assignedLocation), and three stored orderings of the day's route (plannedSequence, optimizedSequence, mostlyFollowedSequence) behind the mobile Timeline/Map views.

Fields

FieldLabelTypeRequiredWhat it does
AccountGroupIdAccount GroupLookup → AccountGroup
AccountIdAccountLookup → Account
AssignedLocationAssigned LocationGeoLocationThe planned position of the stop, stamped at visit generation from the route stop's own coordinates or, when the stop was authored without them, the account's stored geo-location. Geography point, JSON wire shape latitude/longitude.
BranchIdBranchLookup → Branch
CreatedByIdCreated ByLookup → UserAccountYes
CreatedDateTimeCreated DateDateAndTimeYes
DeliveryOrderIdDelivery OrderLookup → DeliveryOrder
DocumentDateDocumentDateDateAndTimeStamped with the actual start timestamp (UTC) when the visit first enters Started - not a user-entered document date. Kept unchanged when a paused visit resumes.
EndTimeEnd TimeTimeOnly
GeofencingToleranceGeofencing Tolerance (KM)Number
IdIdGuidYes
InvoiceIdInvoiceLookup → Invoice
LatitudeLatitudeDecimal
LongitudeLongitudeDecimal
ModifiedByIdModified ByLookup → UserAccountYes
MostlyFollowedSequenceMostly Followed SequenceNumberThe order reps have mostly followed historically on this route: the average actual visit order by start time across earlier plans, copied from the current MostlyFollowed RouteSequence (or computed inline for routes without stored history). Null when the route has no history yet.
NameNameText
NonProductiveReasonNon-Productive ReasonPickListWhy a visit produced no business outcome (picklist). The grain of the Non-Productive Visit report, which groups these by the plan's assigned executive.
OptimizedSequenceOptimized SequenceNumberThe geo-optimized order for this plan's visits: copied from the route's current Optimized RouteSequence at generation (nearest-neighbour, or real road-network order when the paid optimizer ran), and refreshed by the plan's OptimizeRoute action.
OrderIdOrderLookup → OrderThe visit's canonical sales order under the one-order-per-visit rule: stamped automatically when the first Order is created against the visit, and never overwritten - later orders for the same visit remain children via Order.visitId only.
OwnerIdOwnerLookup → UserAccountYes
PartnerAccountIdPartner AccountLookup → Account
PaymentIdPaymentLookup → Payment
PlannedDatePlanned DateDate
PlannedDurationPlanned DurationCalculated (calculated)
PlannedEndTimePlanned End TimeTimeOnly
PlannedSequencePlanned SequenceNumberThe authored route order as planned: seeded from the route stops' sequence at generation and updated together with sequenceNumber when the planned order is deliberately restamped. One of three stored orderings behind the Timeline/Map route views.
PlannedStartTimePlanned Start TimeTimeOnly
ProductDemoIdAppointmentLookup → ProductDemo
RecordTypeIdRecord TypeGuid, hidden
RemarksRemarksMultiLineText
SequenceNumberSequence NumberNumberThe canonical CURRENT order of the visit within its plan - what the mobile Timeline walks. Seeded from the route stop sequence, kept in sync by the rep's drag-reorder, and rewritten by ApplySequenceToPlan and OptimizeRoute (with apply).
ServiceOrderIdService OrderLookup → ServiceOrderThe visit's canonical service order: stamped automatically when the first ServiceOrder is created against the visit and never overwritten afterwards - later service orders stay children via their own visitId.
ShowAcceptRejectOptionShow Accept/Reject OptionBooleanYes
ShowGetDirectionOptionShow Get Direction OptionBooleanYes
ShowProgressPanelShow Progress PanelBoolean
ShowRescheduleOptionShow Reschedule OptionBooleanYes
ShowVisitStartEndOptionShow Visit Start/End OptionBooleanYes
StartTimeStart TimeTimeOnly
UIPropsUI PropsText
UpdatedDateTimeModified DateDateAndTimeYes
VisitCancellationReasonVisit Cancellation ReasonPickListValues: Insufficient Information, Non Availability.
VisitCityVisit CityPickListValues: Pune, Chandigarh, Mumbai.
VisitContactAddressIdVisit AddressLookup → ContactAddress
VisitCountryVisit CountryPickListValues: India.
VisitDateVisit DateDate
VisitDurationVisit DurationCalculated (calculated)Derived, not stored input: minutes between startTime and endTime (0 until both are set). Writing to it has no effect.
VisitLocationVisit LocationGeoLocationThe GPS point captured during execution, stored as a geography point (SRID 4326); the JSON wire shape is an object with latitude and longitude. Compare with assignedLocation, the planned position.
VisitPlanIdVisit PlanLookup → VisitPlan
VisitPostalCodeVisit Postal CodeText
VisitPurposeVisit PurposePickListValues: Payment Collection, Order Capture, Order Delivery, Field Service, Product Demo, Courtesy Visit, Service Touch.
VisitRegionVisit RegionText
VisitRouteIdVisit RouteLookup → VisitRoute
VisitRouteStopIdVisit Route StopLookup → VisitRouteStop
VisitStateVisit StatePickListValues: Maharashtra, Punjab, New Delhi, Haryana.
VisitStatusVisit StatusPickListExecution lifecycle: Planned, Assigned, Started, Paused, Completed, Cancelled, Rescheduled (the mobile client also uses Ongoing for Started). First entry into Started stamps documentDate and startTime (a resume from Paused keeps the originals); Completed stamps endTime. Transitions into execution states are restricted to the plan's assigned resource, and plan completion force-cancels visits not already Completed/Cancelled/Rescheduled. Values: Planned, Assigned, Started, Completed, Rescheduled, Cancelled.
VisitStreetVisit StreetText
VisitTaskTemplateIdVisit Task TemplateLookup → VisitTaskTemplateThe execution playbook for this visit. Setting or changing it regenerates the visit's VisitTask rows from the template's entries - existing tasks are removed and recreated, so it is not a passive reference.
VisitTimeDeviationVisit Time DeviationCalculated (calculated)Derived: plannedStartTime minus actual startTime in minutes (positive = started early, negative = late; 0 until both exist). Writing to it has no effect.

Actions

ActionLabelTypeWhat it does
BulkDeleteDeleteDeleteDelete
CloneCloneServerAction (Clone)Create a copy of this record
ConvertLeadConvert Lead 2ServerAction (serverActionConvert)asdf
DeleteDeleteDeleteDelete
DeleteInListDeleteDeleteDelete
EditEditEditEdit
EditInLineEditEditInlineEdit
EditInListEditEditInlineEdit In List Header
EditPopupEditEditEdit
GetNearbyToOnboardGet Nearby To OnboardServerAction (GetNearbyToOnboard), hiddenRead-only feed for the mobile agenda: returns existing Accounts within a radius of the visit's location that are not yet on the plan or route, plus not-yet-onboarded ProspectPlace rows, both ranked by geodesic distance. Origin is the supplied currentLocation, else the visit's captured location, else its assigned location - with none of these it fails validation. Args radiusMeters (default 3000, max 100000) and maxResults (default 8, max 50). Creates nothing and calls no external provider.
NewNewNewNew

Lookup filters

FilterLookup fieldNotes
Branch For Partner AccountBranchId
Only Partner AccountPartnerAccountId