Value Lists with OData

Value Lists with OData

This topic covers how to configure OData services to provide value lists for the SaveToDB add-in, version 10 or higher.

OData standards do not include features like value lists. To work around this limitation, you can configure missing features in two ways:

  1. Using annotations
  2. Using OData objects to select the configuration

The ODataDB uses value list annotations to configure the built-in JavaScript client, and 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 detects these EntitySets by field signatures and loads the configuration after retrieving the metadata document.

Configuring value lists is similar to the following topics:

However, you'll need to supply OData objects instead of database objects.

For example, when using tables, the configuration looks like this:

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODE
 s02usp_cashbookcompany_idValidationLists02companiesTABLEid, +name
 s02usp_cashbookcompany_idParameterValuess02companiesTABLEid, +name

Suppose your OData service publishes s02.usp_cashbook in the s02 schema with the name usp_cashbook. In this case, you can keep the left part the same since it uses the type schema and name.

However, the handler part must specify an EntitySet instead of the table. If your OData service publishes the table in the default schema container with the name s02_companies, the configuration will look like this:

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODE
 s02usp_cashbookcompany_idValidationListdefaults02_companiesENTITYSETid, +name
 s02usp_cashbookcompany_idParameterValuesdefaults02_companiesENTITYSETid, +name

The SaveToDB add-in supports field list extensions in the HANDLER_CODE field, similar to tables and views. However, the best practice is to create dedicated endpoints to define the value list columns.

Note that the configurations do not conflict. Users can connect to a database and consume the first configuration or connect to the OData service and consume the second one.

Here’s a sample configuration for loading value lists using stored procedures:

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODETARGET_WORKSHEETMENU_ORDEREDIT_PARAMETERS
 s02usp_cashbookcompany_idValidationLists02xl_list_company_idPROCEDURE
 s02usp_cashbookcompany_idParameterValuess02xl_list_company_idPROCEDURE

The corresponding OData configuration would look like this:

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODETARGET_WORKSHEETMENU_ORDEREDIT_PARAMETERS
 s02usp_cashbookcompany_idValidationListdefaults02_xl_list_company_idFUNCTIONIMPORT
 s02usp_cashbookcompany_idParameterValuesdefaults02_xl_list_company_idFUNCTIONIMPORT

This configuration uses FunctionImport objects instead of procedures.

This website is using cookies. By continuing to browse, you give us your consent to our use of cookies as explained in our Cookie Policy.