Push notifications: when polling is the wrong shape
This provider reads. It queries when asked and re-queries when a tile renders. For most questions that is right, and it is the only option against an instance you cannot configure.
But Acumatica can push. Push Notifications (SM302000) sends a POST to a webhook address whenever the result of a definition changes. Definitions are built on a Generic Inquiry or a data query, so the same inquiry that makes a good board also makes a good trigger. Destinations include a webhook URL, a SignalR hub, and message queues. A Daslab scene receives the webhook kind.
When it beats polling
- The question is "tell me when." A production order slipping its promised date, a purchase receipt landing above its quoted price, an order crossing an approval threshold. Polling for these means either latency or waste.
- The data changes rarely but matters immediately. Polling a quiet entity every few minutes spends the per-minute budget to learn nothing.
- You would otherwise poll on a short interval. Every poll is a request against a licensed budget shared with the customer's own integrations (see
api-budget). A push costs that budget nothing per event.
A URL in the scene receives it
Two kinds of URL take Acumatica's POST. Pick by what should happen when one arrives.
Run something on every change: a trigger. trigger_create with when: "webhook" returns an inbound_url. Every POST to it is an event: the trigger's graders decide whether it is worth a run, and the prompt or program runs with the POST body as the event. Test it before Acumatica sends anything with trigger_fire and a test_payload shaped like the body below; trigger_runs shows what each delivery decided.
Keep every delivery, and let a program wait for one: an endpoint. endpoint_create returns a URL that records each request it receives (endpoint_requests reads them back, body included) and answers with an acknowledgement. A program can wait on one particular change with await_event on the endpoint's stream, which endpoint_list shows. Use it to see what the instance actually sends before deciding what to do with it, or when a running program needs to hear that a specific order changed.
Either URL is the credential: anyone holding it can post to it, so keep it in the notification definition and nowhere public. Daslab does not check a header on these URLs, so Acumatica's header fields can stay empty.
Setting it up in Acumatica
Someone with admin rights on the instance does this on **Push Notifications (SM302000)**. It is a screen, not a customization: nothing is deployed into the instance.
- Create a notification with the Webhook destination type, and paste the trigger's
inbound_urlor the endpoint's URL as the address. - Add the Generic Inquiry (or data query) whose result should be watched. A narrow inquiry makes a quiet trigger: one that already filters to late orders sends only late orders.
- Activate it, and change one record the inquiry covers to see a delivery arrive.
What arrives
Acumatica posts JSON naming the definition (Query) and listing the rows that entered its result under Inserted and the rows that left it under Deleted. A changed row arrives as both: its old values under Deleted and its new values under Inserted. A grader can test the body directly, for example cel: size(event.Inserted) > 0 to ignore deliveries where rows only left the result.
Read one real delivery before writing a filter on it: the field names come from the inquiry, not from the REST entity of the same name.