1s 8 periodic register of information change by document. Dimensions, resources and details

There are several types of registers in 1C:

  • Accumulations that store balances or turnover in numerical form;
  • Calculations that store calculation types and calculations themselves are typically used for payroll calculations;
  • Accounting records with data on accounting calculations in the form of Dt-Kt;
  • Information registers.

We will dwell on the latter in more detail, since they allow us to compile data from the database by measurement sections. For example, “Price Nomenclature” stores data for a specific item and characteristics for a certain type of price.

Fig. 1 “Price nomenclature” register

Characteristics

The register can be either periodic or non-periodic, when there is no need to save the sequence of changes. But if you still need to store it, then it is determined within what period the program will establish control over the uniqueness of records: per second, per day, per month, per quarter and per year.


Fig.2 Frequency and recording mode

If you try to create two records within the same period, the program will generate the error “A record with such key fields exists!” and will not allow you to write to the database.

You can also specify the recording mode. The first is with “Submission to the registrar”, in which records will be recorded by documents and in each of them the registrar document will be indicated. If you choose the second - independent mode, then the data is not recorded by the recorder, but is added, for example, directly from the list or as processing.


Fig.3 Recording modes

The peculiarity of the periodic register is that you can use a slice of the last or first ones, obtaining ready-made values ​​from the database about the last/first set value for a certain date.

Entry into the 1C information register

Rows in a register with a period and a recorder containing information about resources in terms of dimensions are called records.

To add a record to a register, either a record manager or a recordset is used. If the entries in the registry have a common key, then you must use a RecordSet. And to record one single record, if all records in the register are unique, you must use the Record Manager.

An example of a record when using the Information RegisterRecordSet object.

Using the recording manager:

NewRecord = Information Registers.Currency Rates.CreateRecordManager(); NewRecord.Currency = Directories.Currencies.FindByName("USD"); NewRecord.Period = Date(31,12,2016); NewRecord.Course = 100; NewRecord.Multiplicity = 1; NewRecord.Write();

When you use a recordset and the Write method, a record is written to the recordset's information register. In this case, either simply adding lines or replacing existing lines in the register can occur. For independent registers, without setting selections, all entries in the register will be deleted and replaced with added entries.

If you write data into a subordinate register without selecting it, an error will occur.

An example of an entry using a set of entries in the PriceNomenclature information register subordinate to the registrar:

NewRecordSet = Information Registers.Nomenclature Prices.CreateRecordSet(); NewRecordSet.Selection.Register.Set(Link); NewRecordSet = NewRecordSet.Add(); NewDialRecord.Period = Link.Date; NewSetRecord.Nomenclature = Link.Nomenclature; NewSetRecord.Price = Link.Price; NewRecordSet.Write();

An example of a recording through the recording manager:

Record = Information Registers.Currency Rates.CreateRecordManager(); Record.Period = Date; Entry.Course = Course; Record.Currency = Currency; Write.Write();

Search and read information register

To find an entry in the information register and read it, you need the help of queries. For example, we need to get prices entered by a certain registrar:

SELECT Nomenclature Prices.Nomenclature, Nomenclature Prices.Price FROM Register Information.Nomenclature Prices HOW Nomenclature Prices WHERE Nomenclature Prices.Registrar = &Registrar

Changing and deleting entries

To delete an information register entry, for example all EUR exchange rates, use the following code:

Selection Structure = new Structure("Currency", Directories.Currencies.FindByName("EUR")); Selection = Information Registers.Currency Rates.Select(,Selection Structure); While Select.Next() LoopRecordManager = Select.GetRecordManager(); Select.GetRecordManager().Delete(); EndCycle;

To quickly and completely clear the register, you can use the following code:

NewRecord = InformationRegisters.TestRegister.CreateRecordSet(); NewRecord.Write();

To adjust and change the register, as well as quickly fill the register with data, you can write a universal processing.

It is implemented in the form of an array of written functions. They must comply with the parameters (types of measurements) accepted in the platform. Where and how are they stored, as well as how to add or delete an entry in the 1C information register?

What is the information?

The composition of objects used by the developer is strictly tied to the platform itself and cannot be changed. It is also not possible to create your own objects - you can only operate with a set already available in the platform.

This structure allows us to standardize the process. On the other hand, this makes it possible for other specialists to modify the solutions obtained.

Standard configuration objects also include a register (English) of information. Its function is to store any arbitrary data in the context of measurements.

For example, exchange rates - by currency, prices - by type of price or in accordance with the nomenclature, etc.

Structure

Data in 1C is saved in the form of records (registration, English). Each of them includes the type of measurements (sections) and the corresponding resource values.

For example, the “Product Prices” register may include the “Product” and “Price Type” dimensions (sections), and the resources include the “Price” value. Thus, its structure develops:

And the records themselves Prices of goods will look like:

For storage additional information For each registration there are “Details”.

Periodicity

To allow changes in static data to be tracked over time, registration has a “Period” field. This is also an additional section for analysis. The frequency value can be selected:

Selecting the Frequency value

Entries to the information register in 1C (their changes) can be made manually. They also change automatically when documents are created.

In the latter case, each registration is updated with a special field to record such a generating document.

It is possible to select a mode. For example, the “Submission to the registrar” mode will cause a strict link to the forming documents.

For example, to change prices, you will need to create a special document - “Change prices”.

Uniqueness of records

To avoid conflicts, each record is unique. It is determined by a key automatically generated by the system. This key depends on the values ​​written in the fields and on which type of register the data is written in.

To create it, three values ​​are taken - the recorder value (slave or non-slave), the period value (periodic or non-periodic) and the measurement value.

Editing

There are built-in forms (by default) for presenting data (although the developer can create his own). For example, list form:

Thanks to it, the user gets the opportunity to view, search, delete/add data, and can also clear the 1C information register.

To log in and work with separate entry There is a form to represent it:

Editing the currency rate in 1C

The capabilities delegated to the developer by these forms:

  • Delete, change, add an entry to the register in 1C;
  • Multilateral, diverse sorting by measurements in time intervals and by recorders.

In this publication, you learned in detail about various 1C registers and learned how to process information in them.

The 1C 8 information register is a metadata object designed to store reference information in the context of dimensions defined by the developer.

A typical example of using an information register is storing information about exchange rates by currency and period.

Let's take a closer look at the properties and settings of the information register.

The two main properties of the convergence register are − Periodicity And Recording Mode.

These are unique properties of the information register that no other metadata object has. Let's take a closer look at them.

This property allows you to add an additional dimension to the list of dimensions - Period. With its help you can solve a large number of tasks: storing information in a database, taking into account its relevance on a certain date. There are many applied examples of using periods: storing the value of a currency for each day, storing the price of an item, etc.

The frequency can take the following values:

  • Non-periodic
  • Within a second
  • Within a day
  • Within a month
  • Within a block
  • Within a year

Get 267 video lessons on 1C for free:

If you select a periodicity other than the Non-periodic option, the system will control the uniqueness of records within the specified period of time. If the record is not unique, the 1C system will display a message and will not allow you to write to the database.

And one of the main features of the periodic information register is the ability to obtain ready-made values ​​of the “Cut of the first” and “Cut of the last”. This information allows you to very quickly obtain from the database information about the last (first) set value on a specific date.

Information Register Write Mode

In 1C 8.2 and 8.3, this property can be either “Independent” or “Submission to the registrar”. In the first case, entries can be made both programmatically and from the list form of the information register. In the second case, it is necessary to indicate the document that records the entry. This imposes certain restrictions, but at the same time opens up new opportunities.

Details Register Dimension Properties

You should also pay attention to the palette of measurement properties of the information register 1C 8.3. Especially for the Leading and Main Selection flags:

  • Presenter— a property of a measurement that implies information that without the value of this measurement, the register entry does not make sense. In fact, this means that when the system deletes a value from a dimension, it also deletes the register entry with the “Leading” dimension. Only one measurement can be set.
  • Main selection— if the register is independent, these measurements will be used to determine the registration of changes for the exchange plan. Similar usage Main selection by period includes the main selection for period for periodic registers.

Program entry into the 1C information register

There are two ways to add new records to the information register: using the record manager and using a recordset. The first case is suitable for a single record, the second - for two or more records.

Using the recording manager:

NewRecord = Information Registers.Currency Rates.CreateRecordManager();
NewRecord.Currency = Directories.Currencies.FindByName("USD");
NewRecord.Period = Date(31,12,2016);
NewRecord.Course = 100;
NewRecord.Multiplicity = 1;
NewRecord.Write();

Using a set of 1C information register records:

NewRecordSet = Information Registers.Currency Rates.CreateRecordSet();
//if you do not set selection, all entries in the information register will be deleted
NewRecordSet.Selection.Currency.Set(Dollar, True);
NewRecordSet.Selection.Period.Set(Date(12/31/2016), True);
//form the set record directly
NewRecordSet = NewRecordSet.Add();
NewSetRecord.Currency = Directories.Currencies.FindByName("USD");
NewDialRecord.Period = Date(12/31/2016);
NewSetRecord.Course = 100;
NewSetRecord.Multiplicity = 1;
NewRecordSet.Write();