New Write Modes for Subordinate Information Registers and Accumulation Registers

1C Developer team

05.11.2024 5 min

New Write Modes for Subordinate Information Registers and Accumulation Registers

We have received requests from developers using our technologies to speed up operations with a significant amount of records. In version 8.3.26, we have made improvements to accelerate such operations for a number of registers.

New Enumeration Value: SubstitutionMode.Update

The RecordSet.<Information_Register_Name>.Write(<Substitution>) and AccumulationRegisterRecordSet.<Accumulation_Register_Name>.Write(<Substitution>) methods can now accept one of the SubstitutionMode enumeration values as the Substitution parameter.

A new element, Update, is added to the SubstitutionMode enumeration in addition to the existing elements (Append, Replace, Merge, Delete). Unlike the Merge mode, in the Update mode, only existing register records that match the key field values of the record set records are updated. New records are not added to the register, which significantly speeds up the write procedure.

Subordinate Information Registers and Accumulation Registers

For subordinate information register and accumulation register record sets, the Write(<Substitute>) method can now use SubstitutionMode as the value of the <Substitute>

 parameter. The accumulation register method has this capability (starting with version 8.3.25), but only SubstitutionMode.Append and SubstitutionMode.Replace are allowed. For the Write(<Substitute>) method of subordinate register record sets, all elements of the SubstitutionMode enumeration except Merge become valid parameter values.

Writing Subordinate Register Record Sets in Update and Delete Modes

It is now possible to write a record set in Update and Delete modes.

When writing in Update mode, existing register records that match the key field values (Recorder, Row Number, separators) with the records contained in the record set are updated. The values of all fields except the key fields are transferred from the record set record to the corresponding register record.

When writing in Delete mode, records with key field values that match those in the record set are deleted from the register. After deletion, the record numbers of the remaining register records are reassigned to fill in the resulting gaps in the numbers.

All accompanying actions (recalculation of totals, registration of data exchange changes, full-text search, recording data history changes, etc.) are performed according to the existing rules.

Writing Subordinate Register Record Sets in Append Mode

It is now possible to write a record set in Append mode without a recorder filter set.

The RowNumber values are automatically assigned to the record set records before writing, based on the maximum record numbers obtained from existing register records, grouped by recorder.

Use Case: Balance Collapse

One possible scenario for using the new modes for the accumulation register is balance collapse. The essence of balance collapse is that the accumulation register records for periods preceding the collapse date are replaced with records representing the initial balances on the collapse date. Accordingly, the set of records for a unique set of dimension values for periods preceding the collapse date is replaced by one record with the same set of dimension values and a period corresponding to the collapse period.

Using the new functionality, the collapse procedure can be significantly accelerated. In general terms, it looks like this (a detailed example will be provided in the documentation):

    • After calculating the integral values of resources by dimension, the "collapsible" records are deleted from the register by writing in replace mode.
    • The newly generated "integral" records are added to the record set without replacement.

This results in N write operations in replace mode of record sets to delete the collapsible records, where N is the number of recorders to which the collapsible records belong, and one write operation of a record set in append mode to write the "collapsed" balances.

We recommend using these new features when developing applied solutions to improve performance, especially in large deployments.

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.