Change Handlers with OData
This topic covers how to configure OData services to provide change handlers for the SaveToDB add-in, version 10 or higher.
OData standards do not natively support change handlers. To work around this limitation, you can configure missing features in two ways:
- Using annotations
- Using OData objects for configuration selection
The ODataDB uses change handler annotations to set up the built-in JavaScript client. The SaveToDB add-in also reads these annotations.
For third-party OData services, developers can publish the xls.handlers table as an EntitySet. The SaveToDB add-in identifies these EntitySets by field signatures and loads the configuration after fetching the metadata document.
Configuring change handlers is similar to the following topics:
However, you need to provide OData objects instead of database objects.
For example, you can set the target EntitySet like this:
ID | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | EVENT_NAME | HANDLER_SCHEMA | HANDLER_NAME | HANDLER_TYPE | HANDLER_CODE | TARGET_WORKSHEET | MENU_ORDER | EDIT_PARAMETERS |
---|---|---|---|---|---|---|---|---|---|---|---|
s02 | cashbook | Change | default | s02_cashbook | ENTITYSET |
Here’s an example using ActionImports:
ID | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | EVENT_NAME | HANDLER_SCHEMA | HANDLER_NAME | HANDLER_TYPE | HANDLER_CODE |
---|---|---|---|---|---|---|---|---|
s02 | usp_cashbook3 | Change | default | s02_usp_cashbook3_change | ACTIONIMPORT |
In both examples, the left side defines object types, while the handler section specifies entity container objects that can execute requests.
Note that these configurations do not conflict with those for database objects. Users can connect to either a database or the OData service, and the add-in will apply the appropriate configuration from the xls.handlers table.
Additionally, you can use the REST API configuration as well.