Scope: managed applications, ordinary applications.
All subsystem settings that can be changed by developers at the integration stage, are divided into settings common for all subsystem objects (or a group of objects) and specific settings for particular objects. When selecting where to place these settings, consider the following guidelines.
1. Set subsystem settings that are common for all or a single group of metadata objects in an overridable module. To do it, create one procedure OnDefineSettings with the Settings parameter of the Structure type, which is initially filled in with default values. When you use a structure as a parameter value, you can expand an application interface by adding new structure properties and not breaking backward compatibility.
For example, defining settings of the "Report options" subsystem that are common for all reports in the ReportsOptionsOverridable common module:
Procedure OnDefineSettings(Settings) Export
Settings.OutputDetails = True;
Settings.OtherReports.ShowCheckBox = True;
1.1. To define a list of configuration objects used by a subsystem, do not use metadata object iteration with the Try Except clause. Create a separate overridable module procedure instead and list such objects there. For example, OnDefineAttachedReports contains a list of configuration reports attached to the subsystem.
1.2. Place procedures that allow you to override business logic for all objects used by a subsystem in an overridable module as well. Name procedures based on the action to perform. For example: OnRegisterReportsOptionsKeysChanges shows changes of report option names. Create a separate procedure for each action to perform.
2. Place object-specific settings or handlers in the object manager module. For procedures that contain information on properties, attributes, or available object methods, use names of the OnDefineSettings<SubsystemName> kind. For example, OnDefineReportsOptionsSettings.
Place procedures that set overridable object-specific business logic in the object manager module. Create a separate procedure for each action to perform. Availability of a procedure in the manager module is set in the OnDefineSettings<SubsystemName> procedure. Thus, you do not need to use the Try Except clause to check whether a procedure is available. For example, the following procedures are set in the report manager module:
Procedure OnDefineReportsOptionsSettings(Settings) Export
Settings.DefineFormSettings = True;
Settings.OnGetReportData = True; // Procedure availability.
Procedure OnGetReportData(Data) Export
// A custom procedure for obtaining data.
The OnDefineReportsOptionsSettings procedure defines report settings and indicates whether there is the OnGetReportData procedure where overridable report data processing is set.