topic hubIntegration & APIsofficial - Microsoftreviewed - checked by Opus

OData

OData web services in Business Central: how to query, filter, modify and batch data, publish metadata, handle limits, tune performance and troubleshoot errors. It answers questions about URI construction, JSON and AtomPub formats, unbound actions, FlowFilters, containments, associations, paging and error codes.

Path: Integration > Web services > OData · tier official · system integration · narrative reviewed (checked by Opus)

Overview

This section covers consuming Business Central data through OData web services. It includes reading data as JSON or AtomPub (V3), getting the EDMX service metadata document, and navigating between published pages with containments and associations. Several pages deal with filtering: filter expressions in OData URIs, general filters for API/OData calls, and FlowFilters for FlowField calculations.

Writing data is covered by the data modification page (POST, PATCH, DELETE on writable pages), the OData V4 unbound action guide, and the transactional $batch page, which runs inner requests in one transaction. Performance guidance, the TopNumberOfRows and Max Page Size page, and the known limitations page help you avoid surprises at scale.

Start with the metadata and JSON pages to learn the URI patterns. Then read the filtering and data modification pages. Check Known OData Limitations and the troubleshooting page before you build a client, or when a call fails.

Key points

  • Data can be returned as JSON (with JSON-P callbacks) or, for OData V3, as AtomPub documents with keyed entries and filtered feeds.
  • The service metadata document is EDMX. It defines the entity data model and can be used by tools such as LINQ.
  • Writes use POST, PATCH and DELETE on writable pages. The InsertAllowed, ModifyAllowed and DeleteAllowed properties and user permissions apply, and triggers run by operation type.
  • OData V4 unbound actions expose AL procedures through web service registration and are not bound to a specific entity.
  • Transactional $batch requests use the Isolation: snapshot header. If any inner request fails, all changes are reverted.
  • Performance tips: Data-Access-Intent ReadOnly, batching, $select, $filter, $top and server-driven paging.
  • For queries with TopNumberOfRows, set Max Page Size (odata.maxpagesize) higher than that value to get correct result counts.
  • Known limitations include no PATCH on collection properties, no OR filters on distinct fields, no lambda operators and no deep insert or deep patching.

Learn pages

Videos and posts

Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 8 of 14 Learn pages

Show 6 more