Improvements for Extensions

1C Developer team

27.10.2022 7 min

8_3_22_Ext.png

We continue to improve the functionality of extensions and, among other things, add features requested by our partners and users.

Template Replacing

The previous version allowed extensions to replace only templates of type Spreadsheet Document.

Version 8.3.22 lets extensions replace templates of any type (both general and metadata object templates). In 1C:Enterprise mode, for configurations with extensions for templates of type Spreadsheet Document, the platform utilizes previously introduced strategies (merge or replacement), while with other types, it uses the template from the latest applied extension.

Permission to Modify Properties That Contain Localizable Strings

Before version 8.3.22, extensions could not modify properties containing localizable strings.

In version 8.3.22, this restriction goes away. It is possible to change the following:

  • Synonym

  • Note

  • Format

  • Editing Format

  • Hint

  • Command Hint

  • Extended Presentation

  • List Presentation

  • Expanded List Presentation

  • Object Presentation

  • Extended Object Presentation

  • Record Presentation

  • Extended Record Presentation

Thus, extensions can offer greater flexibility in adapting configurations to specific projects, for example, by adding a note or a hint relevant to the project specifics. Moreover, it is possible to change the property in all languages defined in the configuration.

Check of Methods in Designer When Evaluating Applicability of Extensions

Sometimes the number of parameters in a method can change with the release of an updated version. If this method is predefined in an extension, applying it from the extension becomes impossible, and the platform uses the method from the configuration.

Also, there might be a case when a method is removed from a configuration. And if such a method is redefined in the extension, then this redefined method’s code in the extension will fail.

Extension developers need to monitor these situations and respond accordingly.

Currently, the platform displays a warning on the failure of a method from an extension only in the 1C:Enterprise mode and only when the main configuration method is called. It makes it difficult for extension developers to find and fix such issues.

In version 8.3.22, such methods can also be checked in Designer mode. Command Extension Applicability Check got two

additional checks for methods that are not standard event handlers:

  • A check if the main configuration contains the method specified in the annotation.
  • A check if method parameters in the extension match the parameters in the main configuration (number and pass-by-value modifiers)
It should make it much easier for developers to adapt extensions to changes in the main configuration.

The current version of the 1C:Enterprise Development Tools includes these checks as well:

Error.png

Option to Change Parameters for Numbers and Object Codes

Previously it was impossible to change length, type, and other object code/number parameters using configuration extensions. Allowing such change of parameters inside the configuration would require enabling support of modifications which makes updating a configuration to a new version a more complicated process.

In version 8.3.22, it is possible to change parameters in some metadata objects via extensions. And this opens the way for using extensions to implement new scenarios. For example, to extend document number length if, under current conditions, there are so many documents that their numbers may not fit into a specified limit. Or to change the number generator type from Number to String if business processes require adding a string prefix to the document number.

See more details below.

Numbering Settings

For objects of type Document, Business Process, Task, and Numerator, it is possible to change the numbering properties in extensions.

It is possible to increase the value for property Number Length. If the property is modified by multiple extensions, the number length is determined by the largest value.

It is also possible to set the value for property Number Type. If Number Type specified in the configuration and the extension do not match, the resulting type will be String because this will store both string values and numbers (converted to a string).

It is allowed to set values for properties Number Allowed Length, Periodicity, and Check Unique. If properties are modified by multiple extensions, the platform will use values from the last extension in the list.

Number Generators

Extensions now allow developers to create their own number generators. It is possible to assign native number generators and the ones adopted from the configuration to both own and adopted documents.

Сode

For objects of the type Exchange Plans, Catalogs, Chart of Characteristic Types, Chart of Accounts, and Chart of Calculation Types in extensions, it is possible to increase the value for property Code Length.

For objects of type Catalogs and Chart of Calculation Types, it is possible to change the value for property Code Type in extensions.

If Code Type in the configuration and the extension do not match, the resulting type will be String because this will store both string values and numbers (converted to a string).

Name Length

For objects of type Exchange Plans, Catalogs, Chart of Characteristic Types, Chart of Accounts, Chart of Calculation Types, and Tasks in extensions, it is possible to increase the value for property Name Length.

If the property is changed by multiple configuration extensions, the platform applies the largest value.

Accessing Configuration Extension Parameters without Installing the Extension to an Infobase.

There might be a case when configuration developers need to access configuration extension parameters without installing the extension into an infobase. If the extension changes the data structure, installing the extension requires the database to be put into exclusive mode and the data to be restructured (which is inconvenient for users). Also, developers might need to check if an extension does change the data structure. Or they might want to get the hash sum to set up a security profile before even installing the extension

In version 8.3.22, we added an optional parameter Data of type BinaryData to method ConfigExtensionsManager.Create(). This parameter receives the content of an extension file. For extensions not installed in the configuration, properties Version, Name, Purpose, DefaultRoles, Synonym, and HashSum are available. Method ModifiesDataStructure() returns True if such an extension changes the configuration data structure after installation.

Previously, to check if an extension changes data structure, developers had to install the extension. And here is the code for this check:

Ext1 = ConfigurationExtensions . Create () ;

Ext1.Write(New BinaryData(“Ext1.cfe"));

ModifiesDataStructure = Ext1.ModifiesDataStructure();

Ext1.Delete();

The new code to run the check looks like this:

Ext1 = ConfigurationExtensions.Create(New BinaryData(“Ext1.cfe"));

ModifiesDataStructure = Ext1.ModifiesDataStructure();

The check does not require putting the configuration to exclusive mode and restructuring the data.

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.