Change Handlers with OData
This topic discusses configuring OData services to supply change handlers for the SaveToDB add-in, version 10 or higher.
OData standards have no features like change handlers.
There are two ways to configure missing features via OData:
- Using annotations
- Using OData objects to select the configuration
ODataDB uses change handler annotations to configure the built-in JavaScript client. The SaveToDB add-in also reads such annotations.
For the third-party OData services, developers can publish the xls.handlers table as EntitySet.
The SaveToDB add-in detects such EntitySets by field signatures and loads the configuration after loading the metadata document.
Configuring change handlers are similar to the following topics:
However, you have to supply OData objects instead of database ones.
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 is a sample of 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 cases, the left part defines object types, and the handler part defines entity container objects suitable to execute requests.
Pay attention that these configurations have no conflicts with the configurations for database objects.
So, users can connect to a database or the OData service, and the add-in will apply the right configuration from the xls.handlers table.
Note that you can use the REST API configuration also.