Configuration initialization

This article is applicable to the managed applications, mobile applications, ordinary applications.

This article describes the standards that apply to the actions performed during the first start of a configuration. All of the listed recommendations are mandatory unless noted otherwise.

1. The configuration must include a check whether it is started for the first time (if true, the Infobase is empty and must be filled with the required minimum of data). It must also include a check whether a new release is started for the first time (if true, required Infobase data updates must be executed).

If your configuration includes 1C:Subsystems Library, implement the checks using the "Infobase version update" subsystem.

If your configuration does not include 1C:Subsystems Library, follow the recommendations provided below.

This recommendation is optional

2. The initial Infobase filling can be split into mandatory and optional parts. The mandatory part is required for the configuration functioning, while the optional part is not required but streamlines the first steps with the product.

3. Once the Infobase processing during the first start of a configuration (or a new configuration release) is complete, we recommend that you display the configuration description or the change log to the administrator.

4. The configuration must control situations where the processing is not fully complete. If this is the case, a warning must be displayed to a user. For recording details of performed operations and errors that occurred during the processing, use the event log.

5. If the configuration is intended to run in distributed Infobase mode, implement the Infobase data update logic in subordinate nodes as follows:

  • update the subordinate node data after loading updated data from the main node; 
  • exclude repeated processing and especially repeated creation of a single piece of data. In other words, ensure the correct operation of the Infobase processing during its second run.

Otherwise:

  • in the event of unconditional data creation during the subordinate node update, this data is created in each node and duplicated many times during the next exchange;
  • in the event of unconditional data change during the subordinate node update, the changed data is exported back to the main node, which provides an additional load to the communication link between the nodes. 

Incorrect:

ProfileObject = Catalogs.AccessGroupProfiles.CreateItem();
ProfileObject.Description = NStr("en = 'Accountant'");
ProfileObject.Predefined = True;
ProfileObject.Write();

Correct:

ProfileDescription = Nstr("en = 'Accountant'");
Query = New Query(
 "SELECT
 | TRUE 
 |FROM
 | Catalog.AccessGroupProfiles AS AccessGroupProfiles
 |WHERE
 | AccessGroupProfiles.Description = &Description AND
 | AccessGroupProfiles.Predefined = TRUE");
Query.SetParameter("Description", ProfileDescription);
// If the item is not found, create it.
If Query.Execute().IsEmpty() Then
  ProfileObject = Catalogs.AccessGroupProfiles.CreateItem();
  ProfileObject.Description = ProfileDescription;
  ProfileObject.Predefined = True;
  ProfileObject.Write();
EndIf;

Next page: General requirements to configurations

Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.