Main > Knowledge Base > Best practices > Creating and changing metadata objects > Global configuration requirements > Configuration initialization > Best practices > Creating and changing metadata objects > Global configuration requirements > Configuration initialization > Best practices > Creating and changing metadata objects > Global configuration requirements > Configuration initialization

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:

Otherwise:

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




© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.