One of the most common integration requirements in Dynamics 365 Finance & Operations is the ability to trigger custom business logic from an external system — not just read and write records, but actually do something: post a journal, recalculate a price, validate an order, kick off a workflow. The standard OData CRUD operations on data entities don't cover this. That's where SysODataActionAttribute comes in.
In this post, we'll look at what SysODataActionAttribute is, when to use it, how to implement it, and how to call it from an external client.
What is SysODataActionAttribute?
SysODataActionAttribute is an X++ attribute you apply to a method to expose that method as an OData action. An OData action is essentially a callable operation — a remote procedure call surfaced through the same OData endpoint that serves your data entities. Once decorated, the method becomes invokable over HTTP by any system that can authenticate against your D365 environment.
This lets you expose bound or unbound operations such as:
- Posting or confirming a document
- Running a calculation and returning the result
- Triggering a batch job
- Performing a validation and returning a status
- Any custom logic that doesn't map cleanly to create/read/update/delete
The attribute signature
The attribute takes two parameters:
SysODataActionAttribute(str actionName, boolean isStaticGlobalAction)- actionName — the name the action will be exposed under in the OData metadata. This is what external callers reference.
- isStaticGlobalAction — a boolean controlling whether the action is unbound (a global, static action not tied to a specific entity instance) or bound (an instance action that operates on a particular record).