# Realtime integrations

Register a realtime trigger and Business Central pushes a notification to SmartConnect the moment a record changes, instead of being polled on a schedule.

## Which endpoints can trigger

An endpoint can push notifications when its underlying entity is change-tracked. The _(Realtime-enabled)_ icon marks every endpoint that qualifies.

## Two kinds of trigger: a record changed, or a named event

A trigger on a document endpoint tells SmartConnect **that** a record changed. Working out **what** changed means reading the record again and comparing it to what you stored, and a cancelled document arrives as nothing more than a delete notification.

For document lifecycles there is a better subscription: the [Document events](https://eonesolutions.github.io/eone-bc-integration/core-documentEvents.md) feed publishes one row per transition, and the row names it. Trigger there and SmartConnect receives `salesDocumentReleased`, `stagedDocumentPosted` or `postedSalesDocumentClosed` directly, each carrying the document's `integrationId`, with no re-read and no diffing. Use a plain change-tracking trigger for master data and quantities; use document events for anything that answers "what just happened to this document".

## Setting one up

Realtime triggers are configured in SmartConnect, not in Business Central. See [Working with SmartConnect](https://eonesolutions.github.io/eone-bc-integration/smartconnect.md).

> **Note:** A trigger is not a guaranteed-ordered event log.

## Common triggers

Integrations most often trigger on:

- **Stock movements.** The availability snapshot is off by default. Enable it, then trigger on `itemInventoryAvailabilities`. See [Availability snapshot](https://eonesolutions.github.io/eone-bc-integration/availability-snapshot.md).
- **A document reaching the ledger.** The posted feeds are change-tracked, so the integration can record the Business Central document number as soon as a staged document posts. See [How document workflow works](https://eonesolutions.github.io/eone-bc-integration/document-workflow.md).
- **An order becoming ready to ship.** Trigger on `documentEvents` and read the `salesDocumentReleased` rows; the event carries the order's `integrationId` and number. See [Document events](https://eonesolutions.github.io/eone-bc-integration/core-documentEvents.md) and [Shipping & dispatch](https://eonesolutions.github.io/eone-bc-integration/shipping-dispatch.md).
- **An invoice getting paid.** Trigger on `documentEvents` with **Posted document status events** enabled, and `postedSalesDocumentClosed` fires when the invoice is fully applied, whichever way the payment arrived.
