Fast. Subordinate directories

Klyuev V.V.

http://prof1c.kklab.ru

Subordinate directories

Most likely, you have already repeatedly noticed in ordinary typical configurations that directories are interconnected, when when you select a directory element (directory 1), the value of another directory (directory 2) is “filtered” by this value - that is, values ​​that belong only to the current directory element are selected; for example, this is the “Division” Directory, the owner of which is the “Organization” Directory.

In order to immediately understand the essence of what is happening, let's look at what happens in practice. To do this, you can create an empty configuration from scratch, or go to any existing copy of the infobase and create 2 directories in the configurator.

Directory1 and Directory2. In directory2, go to the “Owners” tab and select the owner - “Directory1”, see as shown in the figure.

Now, when creating elements in “Directory2”, the system will ask you to enter the owner of directory1. There is an option - Using subordination - when subordination is set to Elements, groups, or groups and elements.

It would seem that everything is simple, but problems arise for users. When opening “Directory 2,” the user sees all the elements in a completely incomprehensible order, and besides, if you worked with standard configurations, you might have noticed that directly in the “Divisions” directory you do not specify the owner anywhere, but when opening the directory you can select organization and, depending on this, receive elements subordinate to one or another organization; Moreover, when creating a directory item “Divisions”, by default you will receive the owner that you selected in the form of the list of divisions.
So let's get started and create a “List Form” for our “Directory2”, for now provide this to 1C without making any changes, later we will adjust the form created by the designer.
In “Directory2” go to the Forms tab and add (+) a new Directory List Form and click Finish.

Let's create a form attribute with the data type "Directory1.Link", with the name "SelectionDirectory1", and drag this attribute onto the form, set the title "Directory1".


Now, in order for “this miracle” to work, you need to write code that will perform a selection when selecting a Directory Element1.

8.2, 8.3 Managed forms

In order to display in the form of a directory list only the elements we need for the selected element of Directory1, we need to programmatically make a selection - by the selected element. To do this, we will use the predefined procedure of the SelectionDirectory1 control and write code that performs the specified task.
At the top, select “Selection Directory1”, right-click and select “Properties”, in the window that appears, find the “OnChange” property and click the magnifying glass, thereby going to the form module; the procedure “Selection Directory1OnChange(Element)” is automatically created

In the procedure, enter the following text:

& On the Client Procedure Selection Directory1OnChange(Element) List. Selection. Elements. Clear() ; // Selection Element = List. Selection. Elements. Add(Type(" Selection ElementData Layout" ) ); Selection Element. LeftValue = New DataComposition Field (" Owner " ); Selection Element. Comparison View = DataComposition Comparison View. Equals; Selection Element. Usage = True ; Selection Element. RightValue = Selection Directory1; Selection Element. DisplayMode = DisplayModeElement aDataCompositionSettings.Unavailable;EndProcedure

8.2 Regular forms


When building forms, everything is the same, only the forms need to be created as regular ones; managed forms do not work in a regular application.
The difference will be in the selection procedure for the element in the list form and the creation of the props.
To add details to a regular form, click the button

Procedure Reference1OnChange(Element)ThisForm. Selection. Owner. Value = Directory1. Link; ThisForm. Selection. Owner. Usage = True ; ThisForm. Form Elements. DirectoryList. Selection Settings. Owner. Availability = False ; //(?) EndProcedure

The penultimate line(?) - we prohibit changing the selection when the user opens the selection parameters - only through the control element!

Video (without sound - everything is clear without sound)

One of the fundamental elements of any 1C configuration is directories. They store information that is used in most other objects of the 1C application. That is why, when developing or upgrading any system on the 1C platform, new directories are first added and filled out. Every 1C developer should know the basic properties, functions and capabilities of these configuration objects.

Structure and functions of directories in 1C 8.3

The main function of directories is to store and provide regulatory and reference information. Accounting in 1C systems is carried out in the context of directories: Nomenclature, Clients and others.

The developers distinguish a separate type of directories - classifiers. These include information approved, for example, by the state:

  • Units;
  • Currencies;
  • Countries of the world;
  • Professions.

By their structure, directories in the 1C program are lists of certain data. To familiarize yourself with existing directories in the 1C configuration, you need to enter it in configurator mode. In the configurator tree, find the “Directory” branch and expand it.

Each of the directories has its own properties set by the developers. Let's look at the main properties using the “Currencies” directory as an example.

The “Basic” tab contains information about the name of the directory and its description. The next section, “Subsystems,” is responsible for including the directory in a specific subsystem.


The Functional Options tab defines functionality using the reference book. The “Hierarchy” tab allows you to create nested directory elements. Hierarchical views of directories can be extremely useful.


On the “Owners” tab, the subordination mechanism is configured. If the directory is subordinate to another, then filling in the “Owner” detail is mandatory.

The “Data” tab determines what information you can add to the 1C directory. At the top you can configure the code and name - one of the standard details, in the center - a list of added details. At the bottom you see the tabular parts of the directory.


The configuration object numbering settings in 1C allow you to create unique numbering for directory elements.


The Forms tab is where developers create interfaces that will be visible to users. The most common forms are Element and List: this is how in the 1C program users see a list of directory data and its elements.


Proper setting of parameters on the “Input Field” tab will create the most convenient working conditions for users. The Quick Select/String Entry/Full Text Search options will help you find the item you need. "Selection history as you enter" will save previously used positions.


The “Commands” section shows a list of existing buttons that call this directory. In “Layouts” you can find all the printable forms of a specific configuration object. “Input based on” will be affected by the developer in cases where it is planned to create other configuration objects based on a directory element.


The “Rights” subsection reflects information about which roles include access to the directory, including filling out directories, changing and reading. “Data Exchange” will inform you which exchange plans the directory participates in. The last tab includes the ability to go into modules for writing procedures and functions. There is also a list of predefined directory values ​​that can be accessed directly in code.


Not all properties are required. Some tabs remain untouched throughout the life of the software on the 1C platform.

To make creating directories in 1C easy, let’s create a new configuration object of this type.

Creating and transferring a directory to 1C 8.3

Using an atypical configuration as an example, we will create and begin to use the “Divisions” directory, which will store data about the structure of the enterprise. In the configurator, in the configuration tree, find “Directories” and click the “Add” button. Fill in the fields:

  • Name/Synonym. The first attribute is responsible for the name of the object in the configuration, the second – for the name in enterprise mode;
  • The object view is used when opening one directory item;
  • List view is used when viewing a list of directory data;
  • Explanation – help for users.


Next, we need to add a new directory to one of the subsystems if we want users to be able to see it in the interface. Open the “Subsystems” tab and check the box next to the already existing “General” subsystem.


Our new directory will be hierarchical, since divisions can fit into one another. There are no groups of departments planned at our enterprise, so the “Element Hierarchy” type is selected. We will not limit the nesting of subdivisions.


In addition to the standard set, we will need a few more details and a tabular part for the list of employees. To do this, you need to add them on the “Data” tab in the appropriate sections.


For convenience, you need to add our details to the list form. To do this, on the “Forms” tab, create a new list form and set it as the main one. In the dialog box, check the boxes for all the details that we need. We will also set the shape of the element in order to arrange the details in the order that suits our users.


This completes the creation of the “Divisions” demo directory. We update the configuration and start the system again in enterprise mode. In the “General” subsystem, the “List of departments” function key has appeared. Clicking on it opens the directory list form we have specified with the ability to add elements to it.


Many companies work with several 1C databases, so the developer may be faced with transferring the created directory to another database. For this purpose, along with most configurations, external processing is supplied - “Uploading and loading XML data”. But before you transfer 1C 8.3 directories, you need to prepare a receiving configuration. A similar configuration object with identical fields and table parts should be created in it.

When opening this processing, we need to indicate which objects we want to transfer and select the file. Then the launched download of the directory creates an XML file where it writes all the data.


To load directories into another information base, you need to go into it and open the same external processing. On the second tab, start downloading. This is a manual mechanism, so if you plan to regularly enter new directory elements in one database, then it is better to organize an exchange between databases.

In conclusion, I would like to remind you that creating directories in 1C 8.3 after the system is put into operation will cause problems due to the need for exclusive access to the database. It is safest to update the configuration on the server.

Find directory item in 1C 8 possible in three ways:

1) Search by code

If known code directory element, and you need to get a link to it, you can use the method FindByCode(<Код>, <ПоискПоПолномуКоду>, <Родитель>, <Владелец>) code directory element and the result will be either a link to the directory element or an empty link if an element with such a code is not found. It should be noted that if the directory contains several elements with the specified code, the one found first will be returned.

FoundElement = Directories.Nomenclature.FindByCode("00000011254" );

Description of method parameters FindByCode:

  • <Код>(required). Type: Number, String. Description: the required code, string or number, depending on the directory settings in the configurator.
  • <ПоискПоПолномуКоду>(optional). Type: Boolean. Description: defines the search mode by full code, true - the searched code should be specified as a string consisting of a sequence of codes by directory levels, separated by the “/” symbol. Default value: False.
  • <Родитель>(optional)
  • <Владелец>(optional)

2) Search by name

If known Name directory element and you need to get a link to it, you can use the method FindByName(<Наименование>, <ТочноеСоответствие>, <Родитель>, <Владелец>) directory manager. In the simplest case, you need to pass to this method Name directory element and the result will be either a link to the directory element or an empty link if an element with the same name is not found. It should be noted that if there are several elements in the directory with the specified name, then the one found first will be returned.

FoundElement = Directories.Nomenclature.FindByName( "Welding machine");

Description of method parameters FindByName:

  • <Наименование>(required). Type: String. Description: A string containing the name you are looking for.
  • ExactMatch> (optional). Type: Boolean. Description: defines the search mode by full match, the search will be successful if the search string: in the case of the parameter value Lie- will correspond to the left side of the name, in the case of the parameter value True- will completely coincide with the name (with the exception of “tail” spaces in the name). Default value: False.
  • <Родитель>(optional). Type: DirectoryLink. Description: the parent within which the search should be performed; if not specified, the search will be carried out in the entire directory.
  • <Владелец>(optional). Type: DirectoryLink. Description: the owner within which the search should be performed; if not specified, the search will be carried out in the entire directory.

3) Search by arbitrary details

If the meaning of any props directory and you need to get a link to it, you can use the method FindByDetails(<ИмяРеквизита>, <ЗначениеРеквизита>, <Родитель>, <Владелец>) directory manager. In the simplest case, you need to pass the name of the attribute and its value to this method, and as a result you will receive either a link to a directory element, or an empty link if an element with such a value of the specified attribute is not found. It should be noted that if there are several elements in the directory with the same value of the specified attribute, then the one found first will be returned.

FoundElement = Directories.Nomenclature.FindByProperties("Article","A-255");

Description of method parameters FindByProps:

  • <ИмяРеквизита>(required). Type: String. Description: the name of the attribute, as it is specified in the configurator, by the value of which the search is carried out. Value type: arbitrary, except for ValueStorage and arbitrary-length strings.
  • <ЗначениеРеквизита>(required). Type: Free. Description: the value of the attribute by which the search should be performed.
  • <Родитель>(optional). Type: DirectoryLink. Description: the parent within which the search should be performed; if not specified, the search will be carried out in the entire directory.
  • <Владелец>(optional). Type: DirectoryLink. Description: the owner within which the search should be performed; if not specified, the search will be carried out in the entire directory.

What are 1C directories and what role do they play in 1C - about this and much more in our new article.

Directories in 1C are created in order to store information that will be used to work in other documents in 1C, for example, reports. It turns out that work in the 1C system is carried out according to reference books, and all the information that is stored in them is called normative and reference.

What are 1C directories intended for?

Any product will serve as a clear example for explanation. For its movement in the enterprise (purchase, storage in a warehouse, installation, sale, etc.), special documents are drawn up, for example, forms, invoices, etc. In a normal situation, all these documents would be filled out manually, but if an automated system is used, this will not only save time, but will also prevent many errors from occurring.

An automated system allows you to create a list once, which then includes this very product. If necessary, you can always indicate the necessary data, characteristics and other information in the description. It turns out that 1C directories are ready-made lists with data about products, clients, services, etc. If necessary, the lists can be changed and supplemented.

Where are the 1C directories located?

Typically, the interface for working in 1C Enterprise is developed by a programmer, which means that different directories can be located in completely different menus.

In the thick client, a user with administrator rights is able to open any 1C document and has access to any directory. To do this, you need to open the “operations” menu, click on “directories” and select the one you need from the list provided.


If you look in the thin client, there is also a similar menu there. It's called "all functions". In terms of its operation, it is similar to the “operations” menu.

In configurator mode, access to all directories is available through the configuration branch. From there you can work with any directory, customize its template, change it, and so on. To get started, double-click on it with the mouse.

What type of 1C directories do they look like?

When you open the 1C 8 directory, a form in the form of a list opens in front of you. For convenience, the lists can be grouped according to certain characteristics and characteristics.


When you open a group, a list of all elements appears in front of you. And after clicking on the element itself, a directory form will become available, the fields in which can be filled out and changed.

Most often in 1C Enterprise there are two required fields for directories:

    Name of the directory.

They are designed to help distinguish one element from another. Sometimes programmers disable these options, but this happens extremely rarely.


The “code” field is most often closed from editing by users (special access rights are required) and its value is generated automatically.

Nomenclature in 1C 8.3 means materials, semi-finished products, equipment, services, returnable packaging, workwear, etc. All this data is stored in the Nomenclature directory. You can get to it from the “Directories” section, subsection “Goods and Services”, item “Nomenclature”

You will see a list of directory positions that has a multi-level hierarchical structure.

In this article we will take a step-by-step look at all the instructions for initially filling out items in 1C 8.3 using an example

For ease of use of this reference book, 1C Accounting uses groups (folders). They combine nomenclature that has common characteristics. In each group, in turn, it is possible to create subgroups (similar to the file system on a computer). The number of hierarchy levels is set by the programmer, but initially there are no restrictions.

Let's create a new group. In the list form of the “Nomenclature” directory, click on the “Create group” button.

Specify the name of the group to be created. You can also fill in its type, but it is not necessary.

As you can see in the figure below, the group we created was placed in “Materials”. If you need to move it to another group or to the root, open the context menu and select “Move to group”. A window will open where you will need to specify a new location.

Creating a new item

Let's move on to adding the nomenclature itself. To do this, in the directory list form, click on the “Create” button. A card of the new item will open in front of you.

Fill in the “Name” field. The value in the “Full name” field will be entered automatically. Please note that the full name is displayed in reports, printed forms of documents, price tags, etc. The “Name” field is used for convenient search of items in the program.

If necessary, fill in the remaining details:

  • The “Item type” and “Included in group” fields are filled in automatically from the data of the group in which the new item item is created. They can be changed if necessary.
  • The value in the “Unit” field is the storage unit for the balances of this item.
  • The tax rate specified in the “% VAT” detail can, if necessary, be changed during the generation of documents.
  • "Sales price" is indicated by default on sales documents. This setting can be changed by clicking on the hyperlink “?” next to this field.
  • In the “Production” section, you can indicate the cost item for a given item and its specification (for finished products), in other words, the composition.
  • Depending on the specifics of the nomenclature, the remaining sections, such as “Alcohol products” and “Imported goods”, are filled in.

After you have filled out the card for the item you are creating, you need to write it down.

What is the type of item in 1C 8.3 and how to configure them

In order to configure the types of nomenclature, click on the corresponding hyperlink in the list form of the “Nomenclature” directory.

Nomenclature types are necessary to separate item items. Each type can be assigned its own. It is very important to avoid the presence of duplicates in this directory, which can lead to incorrect operation of item accounting accounts.

When installing a standard configuration from the supplier, this directory will already be filled in with the main types of items. If the item type is a service, do not forget to put the appropriate flag when creating it.

Item accounting accounts in 1C 8.3

To generate accounting entries, you need to set up accounting accounts. This can be done from the list form of the “Nomenclature” directory by clicking on the “Item Accounting Accounts” hyperlink.

In the standard configuration of 1C Accounting 3.0, this register is already filled. But if necessary, it can be adjusted manually.

Accounting accounts can be configured:

  • according to a specific nomenclature item;
  • by nomenclature group;
  • by type of nomenclature;
  • by warehouse;
  • by warehouse type;
  • by organization;
  • throughout the nomenclature, specifying an empty link as the value.

If different accounting accounts were configured for a specific item and for it, then the account will be taken from the item. In such cases, consolidated accounts have lower priority.

Setting item prices

One item can have several prices. They differ in types, such as wholesale price, retail price, etc.

Go to the “Nomenclature” directory element card and follow the “Prices” hyperlink.

A list will open in front of you, in which you can for a specific type on a specific date. Simply indicate the price in the appropriate column and then click on the “Record prices” button. An item price setting document will be created automatically, and you will see a link to it in this list.

Watch also the video about nomenclature: