Refreshing Dependent Lists

Refreshing Dependent Lists

Let's consider the following configuration:

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODE
 s02usp_cashbookcompany_idValidationLists02companiesTABLEid, +name
 s02usp_cashbookcompany_idParameterValuess02companiesTABLEid, +name

In this example, both the company_id column and parameter pull values from the companies table.

When a user adds or edits entries in the companies table, anyone with the usp_cashbook open must reload data and configuration or validation lists to see the updated values.

SaveToDB 10 offers a better solution: if a user updates source tables within the same workbook, the add-in automatically refreshes company lists for columns and parameters.

This scenario is straightforward since the lists are directly loaded from the updated table.

Now, consider this configuration where we replace the companies table with a procedure that selects values from it:

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODE
 s02usp_cashbookcompany_idValidationLists02xl_list_company_idPROCEDURE
 s02usp_cashbookcompany_idParameterValuess02xl_list_company_idPROCEDURE

In this case, the add-in will still refresh lists automatically if it can parse the procedure definition and determine that it selects data from the table.

You can also explicitly define dependencies using the DependsOn event name.

For example:

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODE
 s02usp_cashbookcompany_idDependsOns02companiesTABLE

This approach is simple; you can copy a line and change ValidationList to DependsOn.

However, it requires duplicating lines for every object and column.

An alternative configuration is:

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODE
 s02xl_list_company_idDependsOns02companiesTABLE

This configuration indicates that the list procedure depends on the companies table. Thus, the add-in will update all lists based on xl_list_company_id when the companies table is saved.

Additionally, you can establish dependencies between edit forms and their underlying tables.

For instance, consider adding a usp_companies procedure used to edit companies and setting the dependency:

IDTABLE_SCHEMATABLE_NAMECOLUMN_NAMEEVENT_NAMEHANDLER_SCHEMAHANDLER_NAMEHANDLER_TYPEHANDLER_CODE
 s02usp_companiesDependsOns02companiesTABLE

In this case, when a user saves changes to the usp_companies procedure, the add-in will update lists based on both the companies table and the xl_list_company_id procedure.

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.