Find an entry in the non-periodic information register.

In this article we will get acquainted with a very interesting 1C configuration metadata object - the information register. Information registers are used to store various information that can be used in an application task. Information in the information register is stored in certain sections, called dimensions, and it can also change over time.

Information registers, information that changes over time is called Periodic, otherwise these registers are called Non-periodic. The periodicity can be different, it can be periodicity per second, minute, hour, etc. maximum - a year.

Non-periodic information register 1C

The main purpose of information registers is that they should store analytics indicators. For example, we have a task to store types of fuel (AI-92, AI-95, etc.), but also the price for this type of fuel. How to organize this conveniently. Definitely, the types of fuel themselves need to be stored in some kind of directory. That’s what we’ll call it – a type of fuel. But where to store the price for this type of fuel? The very first solution in the reference book.

Obviously, such a decision takes place if our price never changes. But this rarely happens in life, so if we do this, then there will be a need to change the directory element every time the price changes. In principle, why not. But, if we also add a new price section - fuel supplier: the same type of fuel may have different prices for different suppliers, then storing the price in the directory details will become fundamentally impossible: we will not know which supplier this price relates to .

To solve these problems, a special configuration object is used - the information register. In this information register, you can create records that indicate that for such and such a type of fuel, for such and such a supplier, such and such a price is set.

Now we will solve this small applied problem: in our configuration there are two directories “Types of fuel” and “Fuel suppliers”

It is necessary to organize the possibility of storing prices for each type of fuel, taking into account suppliers. To do this, we will create a new register of Fuel Prices information.

On the bookmark Basic Let's set the name and synonym. Let's leave everything else as is.

Now on the data tab we will create two dimensions - Type of Fuel and Fuel Supplier, the types of which are links to the corresponding directories.

Let's put a flag on both dimensions - Presenter. This means that if we delete a directory element that is listed in some information register entry, then this entry will be deleted automatically. There is also one interface consequence of this flag: if the flag is set, then in the form of a directory element we can look at the entries of this register for this element.

Let's set this flag for each measurement.

We have non-periodic register, and it has two dimensions Type of fuel And Fuel Supplier this means that we will not be able to create two records with the same field values Type of fuel And Fuel Supplier. The program will throw an error. Which is reasonable - there cannot be two different prices for the same type of fuel from the same supplier. And if it can, then this means that it is necessary to add another section (for example, supplier base).

In addition to measurements, the information register has Resources And Requisites. Resource must store the basic information of the information register, i.e. the data for which it was created, and Props contains additional background information about the entry.

We will create a resource - Price(type number 10.2).

That's all. Let's save the configuration and open this information register and create some kind of record.

If we now try to create a record with exactly the same set of dimensions, an error will appear: “A record with these key fields exists.”

And the last point: since we are at the dimension Type of fuel set the “Leader” flag, then the directory element Types of Fuels a command appeared to open the “Fuel Price” information register

An excellent guide to developing in a managed 1C application, both for novice developers and experienced programmers.

  1. Very accessible and understandable language of presentation
  2. The book is sent by email in PDF format. Can be opened on any device!
  3. Understand the ideology of a managed 1C application
  4. Learn how to develop a managed application;
  5. Learn to develop managed 1C forms;
  6. You will be able to work with the basic and necessary elements of managed forms
  7. Programming under a managed application will become clear

Promo code for a 15% discount - 48PVXHeYu


If this lesson helped you solve any problem, you liked it or found it useful, then you can support my project by donating any amount:

You can pay manually:

Yandex.Money - 410012882996301
Web Money - R955262494655

Join my groups.

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.

1C information registers it is a structured set of data with dimensions and resources. Designed to store periodic information.

Periodicity

Information is stored by dimension and period. You can set the frequency of the information register:

  • Non-periodic
  • by registrar
  • second
  • a week
  • month
  • quarter

Frequency is needed to select information from the register for a certain period of time. If you specify a frequency, entries in the register will be made with the period when the entry was made. Let’s say if you look at the “Item Prices” register, you can see the history of price changes, with what measurements and in what period of time the entry was made.

Periodicity in information registers is needed for information that changes over time, for example: exchange rates, product prices, product discounts and markups, etc.

Registrars

If you make an entry into the information register using a document, you need to set the entry mode: “Submission to the registrar” and select the document with which the entry will be made in the register. Then the “Registrar” field will appear in the register, where information will be stored on what document the entry was made with. The recorder can also be used as a period; to do this, indicate in the “Frequency” field - “By recorder”. Subordination to the registrar is done when it is necessary to strictly link a register to a document and changing entries in the register manually becomes unavailable.

There may be several documents that will act as registrars. In order to add a registrar, you need to go to the properties of the desired information register, go to the “Registrars” tab and check the boxes next to the documents that will act as a registrar.

You can see the movements the recorder makes from the document. To do this, you need to go to the document you are interested in, click: Go – Document movements by the registrar.

Don’t forget to add rights in the registry properties; they can be assigned on the “Rights” tab. Then in the list of roles you need to select the role to which you want to add rights to the register and in the list of rights set the rights to for the selected role.

Uniqueness of records

The uniqueness of a record depends on the period and measurements. For example, if you want to write a record with the same measurements in the “Item Prices” register on the same day, then you will not be able to do this and the program will cause an error, since the periodicity of the register is within a day.

If the frequency is set by the registrar, it also participates in the uniqueness of the record.

For non-periodic and independent registers, uniqueness depends on the combination of dimensions.

Forms

To view records, use the list form, in it you can set the selection according to the fields you are interested in, view the history of records and change them through the record form. You can view register entries as follows: in the top menu, click the “Operations” - “Information Registers” button. In the window that opens, select the register you need. After this, a list form will open in the form of a table, where each entry is a unique entry.

To edit/create, use the record form; if the record is subordinate to the registrar, then the field will not be available and the form cannot be created.

You need to add forms in the configurator by going to the information register, in the “Forms” tab and clicking on the “magnifying glass” next to the desired type of form. Next, a window will open where you can configure the fields of the future form (location, names and specify functionality).


Dimensions, resources and details

Dimensions are intended to form the uniqueness of a record; in the future, you can select them and make a cut based on a specific dimension. The combination of measurements forms the record key. It is better not to create a large number of dimensions so that the table does not grow and does not slow down while working with it.

Dimensions have a “Leading” checkbox; if it is checked, the record will be stored in the database as long as this dimension exists. Several leading measurements can be made. For example, in the information register “Item prices”, the leading dimension is the item; if you delete an item that is included in the record, then the entry in the information register for this item will be automatically deleted.

Resources are designed to store summary information: quantity, price, etc. In the future, we will receive resources for a certain period of time (if the register is periodic), according to measurements.

Details, in most cases, are intended to store additional information; they do not take part in the uniqueness of the record. For example, you can enter information such as author, comment, etc. into the details.

You can perform the following actions with the information register:

  • Deleting an entry in the 1C information register

Peculiarities

— Uniqueness of records based on a set of dimensions: each record in the information register is a new resource value.

— Entries in the information register can be either periodic or not.

— The information register can be dependent and independent of the registrar.

— It is possible to make a cross-section of the first and last records for the desired date. This is implemented by virtual tables: “Slice of the First” and “Slice of the Last”. To use these tables, you can use both selection and query (in the query designer you will select these virtual tables and you can make a query on them). These tables will be available if the information register is periodic.

The “Item Prices” register is a periodic register of information, entries are made according to the registrar.

The image shows that the frequency is set to within a day. This means that the price can be changed once a day based on measurements unique during the day.

The register is subordinated to the document “Setting item prices”. This means that the entry into the register comes from this document. Movements on a specific document can be viewed from the document form “Setting item prices”.

The register is designed to store information on the price of an item, with the dimensions “Price type”, “Item” and “Item characteristics”. The leading dimension is all three dimension fields; it will be possible to make selections based on it when sampling.

Conclusion: After reading the article, you will be able to create a 1C information register, add dimensions and resources, configure editing and list forms. Create a record and select existing records. If you have any questions, use the comments in the article, I will try to quickly answer your question.

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 problems: 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();