Change Handlers with OData

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:

  1. Using annotations
  2. 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:

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODETARGET_WORKSHEETMENU_ORDEREDIT_PARAMETERS
 s02cashbookChangedefaults02_cashbookENTITYSET

Here is a sample of using ActionImports:

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODE
 s02usp_cashbook3Changedefaults02_usp_cashbook3_changeACTIONIMPORT

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.