home · Planning · Fast. Subordinate directories

Fast. Subordinate directories

In previous lessons, we discussed with you that the 1C configuration consists of a set of various 1C objects. There are different types of such objects.

Today we will look at the features of one of the types of 1C Enterprise objects - directories.

1C 8.2 directories are intended for storing information that will be used in other 1C objects - documents, reports. Thus, accounting in 1C is maintained in the context of (by) directories.

Information that is stored in directories is called regulatory and reference information.

Directories 1C 8.2 are divided into Directories themselves and Classifiers. Classifiers (in the conversations of 1C programmers) mean reference books, the composition of which is approved by the state (and there are a bunch of them, for example, Classifier of countries of the world or Classifier of units of measurement).

However, this does not prevent many companies from correcting and supplementing such classifiers as desired.

Why do we need 1C Directories?

A striking example can be made using the example of a product. There is a certain product, for example “Shovel”. Movements of this product (purchase, receipt at the warehouse, sale) are documented with certain documents.

In “life” these are paper documents, because some forms, when filling out which everyone simply writes by hand - Shovel, 20 pieces.

In the electronic system, 1C is electronic documents, which also have a product field. But if each operator writes the name of the product by hand, there may be typos. And then we bought “Shovel” and sold “Lapata”. Additionally, the downside is that we will have to write this many times.

Therefore, we create a list of goods, in which we add this product once. To indicate a product in documents, just select it from a ready-made list. An additional plus is that when we add a product to the list, we can indicate some information about it, for example, “Country of Origin.”

Thus, directories in 1C Enterprise are ready-made lists of data that are needed for accounting - products, customers, etc. Users can supplement and change these lists independently.

Where are the 1C 8.2 Directories located?

In 1C Enterprise mode, the user works with the user interface that the programmer developed for him. Different users may have different interfaces. Therefore, the programmer could place each specific reference book in completely different menus.

In the thick client, a user with administrative rights (Administrator) has a standard Operations menu. In this menu there is a “Directories” item, through which you can open any directory.

In the thin client, the administrator also has a menu, only it is called All functions. Its operation is similar to the Operations item.

In 1C Configurator mode, directories are located in the Configuration branch of the same name, in the configuration window. Having expanded the branch, we can start working with any directory (more precisely, changing or customizing its template). In order to start working with it, you need to double-click on it with the mouse.

What 1C Directories look like

When you open a directory, you see its list form. Since a directory is a list of data, we see it in this form. The list can be grouped into groups for ease of use.

By clicking on the group we fall into it. Clicking on an element opens the directory element form. It consists of a group of fields of this directory, which is supposed to be filled out.

In 1C Enterprise, directories usually have two required fields by which one element can be distinguished from another. This is the code and name of the directory. However, the programmer can disable the presence of these fields, although this is rarely done.

The Code field, which is usually filled in automatically (numbers in order), is usually closed by default from user editing. You can change it in this way (of course, if it is allowed by rights).

1C 8.2 directories can be interconnected (subordinate 1C directory). For example, one element of the Clients directory can have several subordinate elements of the Contracts with Customers directory.

Setting up and developing 1C Directories

You can create a new 1C directory or change an existing one in the configurator. The general working method is the same as with other 1C objects, which was discussed in the previous lesson.

Main features of 1C Directories, by tabs:

Psychiatric hospital. One idiot to another:
-Did you like my story that I gave you to read yesterday?
-Yes, but somehow everything is blurry and there are many characters.
The doctor enters:
-So, idiots, who stole my phone book?...

Purpose of directories
The directory is a list of possible values ​​of a particular attribute. Directories are used in cases where it is necessary to eliminate ambiguous information input.For example, in order for the buyer, seller, storekeeper, director to understand what product we are talking about, everyone must call it the same. And in this case, a reference book is needed. Usually in a trading company it has the form of a price list, and if such a directory is stored on a computer, then the entire possible range of goods that the trading company works with is entered into it.

The 1C:Enterprise system allows you to maintain an almost unlimited number of necessary directories. Each directory is a list of homogeneous objects: employees, organizations, goods, etc. Each such object is called directory element.

From the user's point of view, it should be borne in mind that in the Configurator it is not the directory itself that is created as a list of values, but a template for the directory, its template, is developed. During the configuration process, the structure of information that will be stored in the directory is described, a screen and, if necessary, printed representation of the directory is developed, and various features of its “behavior” are specified.

Directory attributes

As mandatory details, each directory has Code And Name. The directory element code can be either numeric or text. The 1C:Enterprise system provides ample opportunities for working with codes of directory elements: automatic assignment of codes, automatic control of code uniqueness, and others.

In addition to the code and name, any additional information about a directory element can be stored in the 1C:Enterprise system directories. To store such information in the directory, a list can be created details. Using the directory details mechanism, it is easy to organize, for example, an employee file.For example, a directory Employees will almost certainly have the attributes Job title, Salary and others.The 1C company anticipated programmers and introduced all reference books two already defined attributes: Code And Name. Indeed, almost any real-life object contains these attributes. For example, for employees the code is the personnel number, and the name is the last name, first name, patronymic (full name).

Data types

For each directory attribute, you need to specify its data type, for example, " number", "line", "date"(in version 8.0 there is also a Boolean type - True or False). These are basic types, but you can also specify complex data types. For example, an attribute Job title has a data type Positions. In this case, the values ​​of this attribute will be selected from the directory Positions. This is how the simplest connection between directories is realized, when the attribute values ​​of one directory are selected from another directory.

Hierarchical directories

The list of directory elements in the 1C:Enterprise system can be multi-level. In this case, all directory lines will be divided into 2 types: “just” directory elements and groups reference book. Groups allow you to move to lower levels of a multi-level directory. The use of multi-level directories allows you to organize the entry of information into the directory with the required level of detail. Elements and groups of elements in a multi-level directory can be transferred from one group to another.

Subordinate directories

A relationship can be established between directories subordination. In relational database terms, a one-to-many relationship is established between tables. In this case, each element of the subordinate directory will be associated with one of the elements of the owner directory. Sometimes we can say that the elements of one directory belong elements of another. For example, the system may have a Tax Benefits directory. Then it can be done subordinates Directory Employees. It means that "Employee owns tax benefits".

Directory Employees

Directory Tax Benefits

  • Ivanov Ivanov Ivanov
  • Petrov Petr Petrovich
  • Svetlov Mikhail Petrovich
  • Tsvetkov Anton Vasilievich

( owner Petrov Petr Petrovich)

  • Benefits for veterans
  • Benefit for children
  • Ivanov Ivanov Ivanov
  • Petrov Petr Petrovich
  • Svetlov Mikhail Petrovich
  • Tsvetkov Anton Vasilievich

( owner Svetlov Mikhail Petrovich)

  • Benefit for Afghans

Table parts (version 8.0 only)

In version 8.0, it became possible for a directory element to have several tabular parts. It is recommended to use this feature to reflect information related to a given element, but which does not have its own object entity (for which it is recommended to create a subordinate directory). For example, for reference For Products, the Units of Measurement tabular section can be created; for the Employees directory, the Education and Family Composition tabular sections can be created. Working with tabular parts is similar to working with subordinate directories, except that tabular parts cannot be types, which means it will no longer be possible to create an attribute of the Education type.

Comparison of directories with other objects

An object

Similarities

Differences

Constants stores value, saved in database The directory stores not just one value, but a whole list of homogeneous objects.
Documentation saved in the database, has details, documents can be subordinate to each other The directory stores normative and reference information, and documents reflect real world events. Typically, the values ​​of document details are selected from directories. The document is usually posted, the document must have a date and time, the document may contain a tabular part, which is not in directories (in version 8.0, directories and documents can have several tabular parts). Directories can be multi-level; the directory can contain periodic details, which are not in the documents (in version 8.0 there are no periodic details, but there are periodic registers of information).
Transfers stored in the database, stores a list of values The user enters a set of values ​​into the directory in Enterprise mode, and for enumerations the list of values ​​is specified by the developer in Configurator mode. Enumerations are commonly used in If statements.
Table of Values has rows and columns (not stored in the database) The Value Table is designed to store intermediate data in computer memory that occurs during program operation. A table of values ​​can store heterogeneous objects, while a directory can store all elements of the same type. Value tables cannot be multi-level or subordinate to each other.
ListValues stores a list of values ​​(not saved in the database) A list of values ​​can store heterogeneous objects, and in a directory all elements of the same type

Basics of programming

Creating and recording a new element

Finding a directory item


//for example, in a dismissal order
Ref. FindElement(Employee);

Ref. FindByCode(123);
Ref. FindByName("Ivanov Ivan Ivanovich");
Ref. FindByDetails("Salary", 5000);

//if the element is found, it becomes the current one and can be read like this:

If Spr.FindByName("Ivanov Ivan Ivanovich") = 1 Then
........FoundCotr = RefCotr. CurrentItem();
endIf;


//in version 8.0, if the element is found, then it is returned, otherwise it is returned Undefined

FoundCotr = RefCotr. FindByCode(123);
FoundCotr = RefCotr. FindByName("Ivanov Ivan Ivanovich");
FoundCotr RefCotr. FindByDetails("Salary", 5000);

FoundSotr = SprSotr.FindByName("Ivanov Ivan Ivanovich");
If FoundSotr = Undefined Then
.....//element not found
endIf;

Deleting a directory element

Ref. Delete(1); //immediate deletion

Ref. Delete(0); //mark for deletion
Ref. UncheckDelete();


Mark = Ref. FlagDeletion(); //note: this is a method


Ref. Delete(); //immediate deletion

Ref. SetDeleteMark (True); // mark for deletion
Ref. SetDeletionMark (False); //take off mark for deletion

//you can check if an element is marked for deletion
//there is a property MarkDelete, it is of type Boolean - True or False

Mark = Ref. FlagDeletion; //note: this is a property
If Mark = True Then
.....//element marked for deletion
endIf;

Enumerating directory elements


Ref. SelectItems();
While SprSotr. GetElement() = 1 Cycle
...
...Notify("Employee" + Spr.Name);
EndCycle;


selection = Directories.Employees. Choose();
Just a selection for now. Next() = 1 Cycle
... //actions with the next element
EndCycle;


Parent
Iterate over elements within a group. A group in 1C terms is a “parent”.


Ref.FindByName("Working");
Working = Ref.CurrentItem();
Ref. UseParent(Working);
//further, for example, a cycle for employees (see above)
...



GroupWorking = SprSotr.FindByName("Working");
selection = Ref. Choose(GroupWorking);
Just a selection for now. Next() = 1 Cycle
... //actions with the next element
...Notify("Employee" + selection.Name);
EndCycle;

Owner
Enumerating directory elements belonging to an element of another directory.
One reference book subordinate another reference book, for example reference book. Tax Benefits are subject to Ref. Employees.

Periodic details
Reading and writing periodic details.
Setting the date for sampling periodic details for the entire directory.


//this is how we find out what the employee had
//category for a specific date

Category = SprSotr.Category. Get(SomeDate);

//this is how we will set the category for the employee
//for a specific date
RefSort.Category. Install(SomeDate, NewCategory);

//you can set the sampling date for periodic
//details for the entire directory
Ref. UseDate(SomeDate);

//then you can no longer use Install and Get below
//access to periodic details becomes
//same as for regular details
Category = SprSotr.Category;
Spr.Salary = 6000;

In version 8.0 there are no periodic details. Instead, it is necessary to use information registers expanded in time.

Screen forms of reference books

Directory list form

To make it easier for users to work with the directory at the configuration stage, you can create several types screen forms to display the directory. Depending on the context of calling the directory, you can specify the use of a specific dialog to work with it.

It’s better to see once than to hear a hundred times, so below is an example of a list of the Employees directory:




The list form module contains procedures and functions that operate in the context of this form (in the context of the Directory object).

Predefined Procedures are called by the 1C system upon the occurrence of certain events. Predefined procedures are called by the 1C system when certain events occur, so they are event handlers. In version 8.0, the procedure name can be anything, not necessarily the same as the event name. In addition, in version 8.0 the list of events for all objects has been significantly expanded.

Event

Description

WhenOpening Called when the directory list form is opened. You can set initial values ​​for variables, check user rights to open this directory, etc.
At Closing Called when the directory list form is closed.
WhenRecording

Called when writing a directory element, if elements are entered directly in the list form, and not in the element form. This is used for directories with a simple structure, for example the Jobs directory. This procedure allows you to check your input data for errors.

Example, directory Positions

WhenSelectingParent(NewParent) Called when a parent (group) is selected. Use this procedure to verify a user's rights to view members of a given group.
WhenSelectingOwner(NewOwner) Called when the owner of the host directory is selected. It makes sense if this directory is subordinated to another.
WhenSettingSelection(Attributes,Value) A predefined procedure for interactively setting selection in any way (selection, quick selection, selection by value, selection history) and when disabling selection.
OnRowSelect() The line selection processing mode (double-click or Enter key) is enabled in the form of a directory list, document journal, accounts, transaction journal, transaction journal using the Form.RowSelectionProcessing(1) method. Then, when a row is selected, this predefined procedure will be called.


Sorting

In the form of a directory list, elements can be sorted in different orders: by code, by name, or by any attribute that has the Sorting checkbox selected in the Configurator.You can set the sorting type programmatically using the Sorting method (Method, ChangePermission Flag)


Procedure OnOpen()
...... Sorting("Code",0); //sorting by code, user cannot change
End of Procedure

Procedure OnOpen()
......DirectoryList.Order.Set("Name Asc, Card Asc");
......//question to readers: how to prevent the user from changing the sort order?
End of Procedure

Selection

In the directory list form, items can be filtered, i.e. The user will be shown only the necessary elements. You can programmatically set selection using the SetSelection (Attributes, Value) method. To do this, the attribute must have the “Selection by attribute” checkbox checked in the Configurator .

Static filter (version 7.7 only)

In 1C 7.7, you cannot set selection by periodic details or by several details at the same time (complex filter). In this case, the UseList of Elements method may be a way out. This method needs to be passed a list of elements that should be shown. This list needs to be created first.

Procedure ShowWorkingCarpenters()

ElementList = createObject("ValueList");

Ref.SelectItems();

.....If (Adv.Parent = groupWorking) AND (Adv.Position = job Carpenter) Then
..........List of Elements.AddValue(Ref.CurrentElement());
.....EndIf;
EndCycle;

UseListElements(ListItems);

End of Procedure

Element form and group form

If the directory has a complex structure, then it is more convenient to edit its elements in a separate window rather than in a list. Below is the form of the Employees directory element.


The directory element form also has predefined procedures (events):

Events

Description

OnOpen() Called when the directory item form is opened. You can set initial values ​​for variables, check user rights to open a given directory element, etc.
OnClose() Called when the dictionary item form is closed.
OnWrite()

Called when a directory element is written. This procedure allows you to check your input data for errors.

Example, directory Employees

Recording Procedure
....If Category.Selected()=0 Then
.........Warning("Employee category not specified!");
.........ReturnStatus(0);
.....EndIf;
End of Procedure

EnterNew() Called when a new directory element is interactively entered. In this procedure, you can check the user's rights to create new directory elements, as well as set the initial values ​​of the details.

It should be noted that in version 8.0 the list of events for all objects has been significantly expanded.

Creating and recording an element

Programmatic creation of a directory element

Below in the Employees directory, a new employee is programmatically added to the Working group. The fields Name, Reception Date and a couple of periodic details are filled in in the directory.



Ref. New();


Ref. Write down();
//setting periodic details is possible only after recording the element
Ref.Category.Set (Ref.ReceptionDate, ktgPartners);
Ref.Position.Set (Ref.ReceptionDate, forCarpenter);

But you can make it more beautiful:

RefCotr = CreateObject("Directory.Employees");
SprSotr.UseParent(grpWorking);
Ref.UseDate(ReceptionDate); //attention!
Ref.New();
SprSotr.Name = "Ivanov Ivan Ivanovich";
Ref.ReceptionDate = "01/01/2002";
//access to periodic details becomes the same as to regular ones
SprSotr.Category = ktgPartners;
Spr.Position = dljCarpenter;
SprCotr.Write();

New = Directories.Employees.CreateItem();
New.Parent = groupWorking;
New.Name = "Ivanov Ivan Ivanovich";
New.ReceptionDate = "01/01/2002";
New.Write();

//in version 8.0 there are no periodic details

Programmatic creation of groups

RefCotr = CreateObject("Directory.Employees");

Ref. A new group();

Ref. Write down();

Ref.NewGroup();

SprCotr.Write();

New = Directories.Employees .To create a group();

New Write down();

New = Directories["Employees"] .To create a group();
New.Name = "Working";
New Write down();

Attention!

Transactions

When creating many directory elements, you can enclose a cycle in a transaction to speed up the work. In this case, the actual creation of all elements will occur only with the CommitTransaction() command. The directory is blocked while the transaction is running.

RefCotr = CreateObject("Directory.Employees");
StartTransaction();

For Nom = 1 To 100 Cycle
.....Ref.New();
.....SprSotr.Name = "New" + String(Nom);
.....RepCort.Write();
EndCycle;

CommitTransaction();


SprSotr = Directories.Employees;
StartTransaction();

For Nom = 1 To 100 Cycle
.....New = SprSotr.CreateElement();
.....New.Name = "New" + String(Nom);
.....New.Write();
EndCycle;

CommitTransaction();

Iterating over elements

Simple search

RefCotr = CreateObject("Directory.Employees");
mode = 0; //select without taking into account the hierarchy, 1 - taking into account (by default)
Ref. SelectItems(Mode);
While SprSotr. GetElement()=1 Cycle
.....<действия с очередным элементом/группой>
EndCycle;

Filtration (selection)

RefCotr = CreateObject("Directory.Employees");
HierarchyMode = 1; //1 - select taking into account the hierarchy, 0 - without taking into account
GroupMode = 0; //0 - do not include groups in the selection, 1 - include
AttributeName = "Year"; //in the Configurator, the attribute must have the Selection checkbox checked
value = 1980;
Ref. Select ElementsBy Details(AttributeName,Value,HierarchyMode,GroupMode);
While SprCont.GetElement()=1 Loop
.....<действия с очередным элементом>
EndCycle;

Filtering in a loop

RefCotr = CreateObject("Directory.Employees");
SprSotr.UseParent(grpWorking);
Ref.UseDate(WorkingDate());
Ref. SelectItems();
While SprSotr. GetElement()=1 Cycle

If Administrative Position<>dlzhCarpenter Then
....Continue; //we skip this employee, go to the beginning of the cycle
endIf;

<действия с очередным элементом>

EndCycle;

Sorting order

Before sampling, you can set the sort order using the following methods:

CodeOrder()
NameOrder()
Attribute Order(ReqName) //the attribute must have the Sorting checkbox checked in the Configurator
Reverse order()

For example, below opens a selection of employees, sorted by number in descending order:

RefCotr = CreateObject("Directory.Employees");
Ref.CodesOrder();
Ref.ReverseOrder();
Ref.SelectItems();

Request to the directory

The search of directory elements can be organized through Request. This is often more convenient if a complex selection condition or grouping of elements is used. See more details. Requests

Search for an element

Search for an element

RefCotr = CreateObject("Directory.Employees");
If SprSotr. FindElement(SelectSotr)=1 Then
....//the element becomes current
....SprSotr.Parent = grpWorking;
....RepCort.Write();
endIf;

Search by code

If SprSotr. FindByCode(1) = 1 Then
....ElementOrGroup = Ref.CurrentElement();
endIf;

Search by name

If SprSotr. FindByName("Working")=1 Then
....grpWorking = Ref.CurrentItem();
endIf;

mode = 1; // 1 - search within the established subordination (parent) (default); 0 - search in the entire directory
SearchFlag = 0; //1 - find exact match; 0 - find name by first characters (default)
SprSotr.UseParent(grpWorking);
If Ref.FindByName("Iv",Mode,SearchFlag)=1 Then
....FirstWorkingIv = Ref.CurrentItem();
endIf;

Search by details

ReqName = "Year"; //the attribute must have the Sorting checkbox checked in the Configurator
SearchGlobeFlag = 1; // 1 - search in the entire directory, 0 - search within subordination
If SprSotr. FindByDetails(ReqName,1980,SearchGlobeFlag)=1 Then
.....FoundElement = Ref.CurrentElement();
endIf;

Finding an element in a loop

RefCotr = CreateObject("Directory.Employees");
SprSotr.UseParent(grpWorking);
Ref.UseDate(WorkingDate());
Ref. SelectItems();
While SprSotr. GetElement()=1 Cycle

If Admin.Position = dlzhCarpenter Then
....Abort; //found a working carpenter! get out of the loop
endIf;

EndCycle;
<действия с найденным элементом>

Request to the directory

The search for a directory element can be organized through Request. This is often more convenient if a complex selection condition is applied. See more details. Requests

Removing items

Direct removal

RefCotr = CreateObject("Directory.Employees");
SprEmployee.FindElement(SelectEmployee);
Ref.Delete(); //immediate deletion

Attention! If you directly delete an element, make sure that there are no references to it in other objects. For example, the employee being removed can be used in the Vacation document. If it is deleted, the referential integrity of the database will be broken. In this case, it is recommended to use marked for deletion.

You can programmatically obtain a list of objects containing a link to the object to be deleted using the FindLinks(object) method.

Mark for deletion

To control the referential integrity of the database, deleted elements are simply marked for deletion. Then, using a special menu command Operations => “Deleting marked objects” in exclusive mode, the 1C system will check referential integrity and physically delete elements from the database if there are no references to them in other objects.

SprSotr = CreateObject("Directory.Employees");
Ref.FindElement(SelectEmployee);
Ref.Delete(0); //mark for deletion

//you can check if an element is marked for deletion
//function returns 1 - if marked, 0 - if not
Mark = Ref. FlagDeletion();

//you can uncheck the deletion mark
Ref.FindElement(SelectEmployee);
Ref. UncheckDelete();

Transactions

When deleting many directory elements, you can enclose a loop in a transaction to speed up the work. In this case, the actual deletion (mark for deletion) of all elements will occur only with the CommitTransaction() command. The directory is blocked for the duration of the transaction.

RefCotr = CreateObject("Directory.Employees");
StartTransaction();

Ref.SelectItems();
While SprCont.GetElement()=1 Loop
......Ref.Delete(0); //mark for deletion
EndCycle;

CommitTransaction();

Hierarchical directories

The list of directory elements in the 1C:Enterprise system can be multi-level. In this case, all directory lines will be divided into 2 types: “simply” directory elements and directory groups. Groups allow you to move to lower levels of a multi-level directory. The possible number of directory nesting levels is set in the Configurator.

The use of multi-level directories allows you to organize the entry of information into the directory with the required level of detail. Elements and groups of elements in a multi-level directory can be transferred from one group to another.

Attention! Hierarchical reference book is also multi-level directory, or directory with groups.
A directory group in 1C is often called " parent".

Programmatic creation of a group

RefCotr = CreateObject("Directory.Employees");

Ref. A new group();
SprSotr.Name = "Working";
Ref. Write down();

Ref.NewGroup();
Ref.Name = "Dismissed";
SprCotr.Write();

Attention! In the Configurator, you can set the attribute to be valid only for an element, only for a group, or for both. For example, the Reception Date field does not make sense for the Working group. Therefore, you should not access element details if you are working with a group and vice versa.

Setting the current group


Ref. UseParent(grpWorking); //now we are inside the Working group
Ref.SelectItems(); //open a selection of elements of the Working group

RefCotr = CreateObject("Directory.Employees");
Ref. UseParent(grpWorking);
Ref.New(); //creating a new element in the Working group

If the directory is multi-level, then it will be useful to use the following methods and attributes that allow you to obtain information about the current directory element:

Method/attribute

Description

Level()

This method returns the level of the current element. For example, for an employee who is in the Working group, we will get the number 2.

Example, output of a hierarchical directory in the form of a tree:

RefCotr = CreateObject("Directory.Employees");
Ref.SelectItems();

//display indentation according to element nesting depth
For Nom=1 By Const.Level() Cycle
.....To report(".....");
EndCycle;

EndCycle;

This group() This method returns 1 if the current directory element is a group, or 0 if it is not a group.

Example, output of employees (groups are not output):

RefCotr = CreateObject("Directory.Employees");
Ref.SelectItems();
While Ref.GetItems()=1 Loop

If Ref.ThisGroup()=1 Then
......Continue; //skip groups, go to the beginning of the loop
endIf;
Report(Ref.Name);

EndCycle;

Belongs to the Group(...) The method checks whether the current directory element belongs to the specified group (regardless of the underlying level it is located at).
Returns: 1 - if the element belongs to the specified group, 0 - if not.

Example, displaying products belonging to the Alcohol group, regardless of whether they are included in the subgroups Champagne, Beer, Vodka, Wine, etc.:




.....Notify(SprProducts.Name);
endIf;

EndCycle;

attribute Parent

This attribute contains the parent of the current directory element, i.e. the group in which the current element is located. Readable and writable.

Example, transferring all products from the Alcohol group to the Sale group:

DirectoryProducts = CreateObject("Directory.Products");
SprProducts.SelectItems();
While SprProducts.GetItems()=1 Loop

If Products.Belongs to Group(groupAlcohol)=1 Then
.....SprSotr.Parent = grpSale;
.....RepCort.Write();
endIf;

EndCycle;

Or you can make it more beautiful and move the entire Alcohol group to the Sale group, then all subgroups and elements will also be transferred to the Sale group.

DirectoryProducts = CreateObject("Directory.Products");
SprProducts.FindItem(grpAlcohol);
SprProducts.Parent = grpSale;
SprProducts.Write();

FullCode()

Returns a string containing the full code of the selected directory element with all higher levels separated by the "/" character.

For example, "2/7/123"

Full name()

Returns a string containing the full name of the selected directory element with all higher levels separated by the "/" character.

For example, "Alcohol/Champagne/Soviet"

Ability to select a group in dialogue props

It is often convenient for details on the form that have the Directory type to disable the ability to select a group. Then only an element can be selected in this field and a group cannot be selected. In general, it’s easier to try once than to explain several times.

Form.SelectEmployee. Group Selection(0); //disable the ability to select a group

Subordinate directories

Directory- owner, this is also a reference book - master.
The owner directory and the slave directory are also called related reference books.
In relational database terms, the owner directory is the parent table, the slave directory is the child table.

Assignment of subordinate directories

Any directory can be used either by itself or be subordinate to some other directory. For example, a directory of contracts can be used separately, or it can be linked to a directory of organizations.

To subordinate a directory to any of the directories that already exist in the system, in the “Subordinated” field, select the name of this directory. Such a directory in the 1C:Enterprise system is called the owner.

Unlike a multi-level directory, in which all elements have the same structure, using the mechanism of subordinate directories allows you to link elements of different structures. In this case, each element of the subordinate directory will be associated with one of the elements of the owner directory.

Externally, working with a subordinate directory in the 1C:Enterprise system will look like this.

If the display mode in the form of a hierarchical list is set for a subordinate directory, then before using the directory, the owner directory element must first be selected. When displayed on the screen, the subordinate directory will contain in its title the name of the owner element, and the list of elements of the subordinate directory will contain only elements related to the owner element. When the owner element changes, the information in the subordinate directory window will be updated accordingly.

If you open a subordinate directory without selecting the owner element, then no element will be displayed in the window of the subordinate directory, and the message “Owner element not specified” will be displayed in the window title.

When working with the 1C:Enterprise system, display in the form of a hierarchical list can be disabled for a subordinate directory. In this case, all the elements of this directory will be displayed in the window of the slave directory, that is, elements assigned to different owners will be shown mixed up. However, any element of a subordinate directory “knows” its owner: if the “Edit in dialog” mode is enabled for the directory (see below in “Creating directory forms”), the name of the owner element will be displayed in the title of the directory element editing window.

Setting the current owner


SprAgreements.UseOwner(SelectContractor);
SprAgreements.SelectItems(); //open a selection of agreements of the selected counterparty
<...>

Information about the current element

If the directory is subordinate, then it will be useful to use the following methods and attributes that allow you to obtain information about the current directory element:

Attribute

Description

attribute Owner

This attribute contains the owner of the current element of the subordinate directory, i.e. element of the host directory to which this element belongs. The attribute is readable and writable.

Example, transfer of all contracts from one counterparty to another (the Contracts directory is subordinate to the Counterparties directory):

DirectoryAgreements = CreateObject("Directory.Agreements");
SprAgreements.UseOwner(Counterparty1);
SprAgreements.SelectItems();
While SprAgreements.GetElements()=1 Loop

SprAgreements.Owner = Counterparty2;
SprAgreements.Write();

EndCycle;


Periodic details

Enabling the “Periodic” option allows you to specify for a directory attribute to store the history of changes in its value. Such a detail in the 1C:Enterprise system is called periodic and has the following property: unlike “ordinary” (non-periodic) details, the 1C:Enterprise system stores the values ​​of such a detail according to the dates of their change. When accessing the value of such an attribute for a certain date, its value is returned for that date, or, if it is missing, for the nearest previous date on which the attribute’s value was set.

This property of the directory details makes it possible, for example, to easily organize the storage of the history of exchange rates in the currency directory.

Periodic details can be accessed using the built-in language of the 1C:Enterprise system - receive and record the value of the details for a specified date. However, it should be borne in mind that when receiving the value of a variable for a certain date, its value is retrieved for the specified or (if there is no value for the specified date) for the nearest previous date, and the value of the periodic variable is always recorded for the specified date.

In the mode of using the configuration for periodic details, you can open the “History” window. This window is a table consisting of two columns: the date the directory attribute value was changed and the value as of that date. The “History” window allows you to edit the history of changes to the attribute value directly: enter new lines, edit or delete existing ones.

Periodic details methods
//this is how we find out what category the employee had on a certain date
Category = SprSort.Category.Get(SomeDate);

//this is how we will set the employee’s category for a specific date
Ref.Category.Set(SomeDate, NewCategory);

Attention! These methods can be used if you have not previously used the UseDate method

Setting the date for sampling periodic details

//you can set the date for sampling periodic details for the entire directory
Ref. UseDate(SomeDate);

//then it’s lower already it is forbidden use the Set and Get methods
//access to periodic details becomes the same as to regular details
Category = SprSotr.Category;
Spr.Salary = 6000;

Object "Periodic"

To work with the history of periodic details, it is very convenient to use the “Periodic” object.

Example, display the employee’s career history for the current year:

HistoryCareers = CreateObject("Periodic");
CareerHistory.UseObject("Position", SelectEmployee);
Career History.SelectValues(Start of Year(WorkingDate(),End of Year(WorkingDate()));
While HistoryCareers.GetValue()=1 Loop
....Report(String(CareerHistory.DateValue) + " " + String(CareerHistory.Value));
EndCycle;

You can also edit and delete values ​​using the Periodic object. For a complete list of methods, see the Syntax Helper.

Carrying out documents

When posting a document, it is often necessary to set a new value for a periodic attribute for a specific date. This is called document movement. In this case, you should use the Set Directory Attributes method:

Set Directory Details(Employee, "Position", NewPosition, MoveDate);

End of Procedure

If the document has a tabular part and you want document movements to be linked to the document line number, then you should use the BindRow method.

Procedure ProcessingConduct()

SelectRows();
While GetString()=1 Loop

BindString(RowNumber);
Set Directory Details(Employee, "Position", New Position, Move Date);

EndCycle;

End of Procedure

Selection from the directory

The selection function allows you to select multiple values ​​from a lookup or other object without closing it.For example, there is an Invoice document in which the user can specify several products.

Organization of selection

Syntax: OpenSelect(<Объект>,<ИмяФормы>,<КонтекстФормы>,<ФлагМножВыбора>,<ТекЗнач>)

OpenSelection("Directory.Nomenclature","FormForSelection",Cont,1);


...New line();
...Product = Item;
End of Procedure

You can use the form context and immediately go to the desired group, for example:

OpenSelection("Directory.Nomenclature","FormForSelection",Cont,1);
Cont.UseParent(grpAlcohol);

Procedure ProcessingFit(Element,FormContent)
...New line();
...Product = Item;
End of Procedure

Setting and getting values ​​from selection

ContFormSelection. SetValueInSelection(<ИмяРеквизита>,<Значение>)

<ИмяРеквизита>- line with the name of the attribute of the value selection form;
<Значение>- the value of the attribute.

ContFormSelection. GetValueFromSelection(<Выражение>)

<Выражение>- a string expression whose value is calculated in the context of the selection form and returned as a result.

Other Useful Methods

Method

Description

View() Set or read the current name of the directory type. Returns the current name of the directory type, as specified in the Configurator, for example, “Employees”. Setting the type of directory is possible for details of the "Directory" type, i.e. directory of indeterminate type.
ViewView() Get a custom view of the directory view as specified in the configurator.
Returns a string value containing a custom representation of the directory view (synonym).
SetAttribute(AttributeName, Value) Set the value of the attribute by its name.
<ИмяРеквизита>- a string expression containing the name of the attribute, as specified in the configurator.<Значение>- an expression containing the value of the attribute to be set.
GetAttribute(AttributeName) Get the value of an attribute by its name. Returns the value of the attribute.
Selected()

Returns 1 - if the directory element is selected, 0 - if not selected. Often used to check for errors to ensure that all required data is provided.

Choose(...) Calling a dialog to select a directory element.
Returns: 1 - if the element is selected; 0 - if not selected. The selected element becomes the current one.

Reading the directory structure

Cycle according to reference books

Number of DirectoriesInConfiguration = Metadata.Directory();
For Nom=1 to Number of DirectoriesIn Configuration Cycle

cfgSpr = Metadata.Directory(Nom);
Identifier = cfgSpr.Identifier();
FullIdentifier = cfgSpr.FullIdentifier();
Synonym = cfgSpr.Synonym();

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 = NewDataCompositionField("Owner" ) ; SelectionElement.ComparisonView = DataCompositionComparisonView.Equals; SelectionElement.Use = True ; SelectionElement.RightValue = SelectionDirectory1; SelectionElement.DisplayMode = ElementDisplayMode constructionDataComposition.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)

To work with constant and conditionally constant information with a certain set of values, the system uses objects of the “Directory” type.

In a specific configuration, the required number of directories is created to store data about objects used in the automation of a given subject area. For example, these could be directories “Organizations”, “Products”, “Employees”, etc.

In addition, directories are used to organize analytical accounting, which eliminates ambiguity when filling out the details of documents or other directories. When entering information into on-screen forms of a document, the minimum of this information is entered from the keyboard, and most of it is entered by selecting from opening directories.

As a rule, the directory can be edited during work - new elements can be entered, existing ones can be edited or deleted (unless this is prohibited for a specific user).

Work with directories is carried out in two modes:

In viewing and editing mode. In this case, the directory is opened from the main menu of the program or using the corresponding icon on the toolbar.

In the mode of selecting a directory element. In this case, the directory is opened using the button

or the F4 key when entering the required information into a document or other reference book.

The differences between these two modes are that in the mode of viewing the directory from the main menu, pressing the ENTER key (similar to double-clicking) will open the current directory item for editing. Similar actions in the selection mode from the directory will lead to the selection of the current element for inserting it into the document to be filled out.

5.1. Directory window

To display the desired directory on the screen, you can use the main menu commands (for example, directory "Counterparties" opens from menu item "Primary activity", reference book "Organizations"– from menu item "Organizations" etc.). If there is an item in the main menu "Operations", then the directory can be called by selecting "Operations-Directories". A list of existing directories in alphabetical order will be displayed on the screen:



Having selected the desired directory, click "OK".


Here's what the directory dialog box looks like in general:



If the directory has a hierarchical structure, the directory window may contain a tree of groups.

When you click on the sign «+» at a node - the branch will open. You can close a tree branch by clicking on the sign «-» .

You can view the tree using the numeric keys:

“*” – opens all branches of the tree at once;

“-” – hides all tree branches of the current group;

“+” – reveals the next level of branches of the current group.

If on the menu "Actions" Display as a hierarchical list is set or a button is pressed

on the toolbar, then in the leftmost column of the table field of the hierarchical directory, symbols indicating the type of line are displayed;

=> The string is a directory element


=> A row corresponds to a group of elements. Double-clicking the left mouse button on this icon expands the group.


=> The line contains the name of the group that is open for viewing. Double-clicking the left mouse button on this icon closes the group


For single-level directories that do not have a hierarchical structure, the icons do not differ.

When in a multi-level directory mode "Hierarchical View" is turned off, then all groups and elements of the directory are shown intermixed. This can be convenient if the directory has a complex hierarchy and you do not remember exactly in which group the element you need is located. With the hierarchical list enabled, you would have to sequentially open and close numerous folders to find the desired element; with the hierarchy disabled, when all elements are visible on the screen, it is much easier to do this using one of the search options (quick or random). When the hierarchical list is disabled, all directory elements are arranged by name (in alphabetical order). The sorting of the directory can be changed. To do this, in the “Actions” menu item, select the “Sorting” sub-item and the “Order by: Code” option. In this case, the directory elements are arranged in ascending order of their codes. This sorting can be useful when answering the question of which elements were entered into the directory earlier and which later, since when new elements of the directory are entered, the code is automatically assigned one greater than the last one.

You can work with directory elements using the “Actions” menu item in the directory window, or using the icons on the directory toolbar:


=> A new directory element is created by copying the element selected by the cursor


=> To transfer an element or group from one group to another group in the directory, you need to place the cursor on the line with the element that needs to be moved, then select the item “Actions – Move to group” or use the corresponding button. After this, in the group tree dialog that opens, select the name of the group where you intend to move the element.


=> When working online, you can update the current directory list using the button on the toolbar or by pressing CTRL+SHIFT+R.


=> In order to use the program’s help system, you can press the F1 key or click the button on the toolbar


=> The current directory item opens for editing (similar to the F2 key). It is this button that can be used if the directory is opened in selection mode, and an error is detected in the title (or other details). Using this button, the element will be opened for correction, after which you can select it with the ENTER key.


=> Set a mark for deletion (analogous to the DEL key).

5.2. Entering information into the directory

To enter a new element, select “Actions – Add” directory list form or press the INSERT key or you can use the buttons on the directory toolbar:


Add element


Create a new group (CTRL+F9)


In order for a new element to immediately fall into a specific group, before entering the element you must first go to this group.

If display in the form of a hierarchical list is disabled for a hierarchical directory, a new element is entered into the current group (the one that was selected before changing the viewing mode) or into the root group.

If the element input form provides the attribute "Parent", then regardless of the mode and current group, you can indicate membership in any other group.



The form fills in the basic details "Code" And "Name" and other directory details. If this is due to the configuration, when entering an element, its code will be checked for uniqueness; if it matches one of the codes already available in the directory, a message will be displayed “The code is not unique!”. In this case the code must be fixed.

To record an item in the directory, click the button "OK". To refuse to enter a new element into the directory, press the button " ESC". If you enter information about a directory item in a separate dialog box, you will be prompted to save changes, which in this case should be answered “ No».



If for a particular directory there are two options for entering a new element (directly in the list of the directory or in a separate dialog box that opens), then the specific option is selected from the menu item "ActionsEdit in dialogue", which represents a switch. When the item is “pressed”, input is carried out in the dialog, when “pressed” - in the list.

If it is possible for a directory to organize a hierarchical structure in it, then to enter a new group you should select the menu item "ActionsA new group" list form or use the button

toolbar of the directory window.

Just as when entering a new element into the directory, when entering a new group, editing the code, name and other details of the group can be done in two ways: in the directory list or in a separate dialog box. The editing method is determined at the configuration stage.

5.3. Editing information in the directory

The procedure for editing information in the directory differs depending on whether this happens in the list line of the directory or in a separate dialog box:


When editing in a line, place the cursor in the desired line and double-click the left mouse button or press the key ENTER. The cell will switch to edit mode. Let us remind you that the described methods do not work if the directory is open in selection mode. Double click or key ENTER in this case, it makes a selection from the directory. To edit a directory element opened in selection mode, select the item "Action-Change" or press a key F2.You can navigate through the details of the edited directory element using the keys Tab, Shift+Tab or mouse. To consolidate the editing results, press the key ENTER or button

on the toolbar of the reference window. To refuse editing the details, press the key ESC.

To edit a directory element in dialog mode, you should also place the cursor in the desired line and double-click with the left mouse button or press the key ENTER. A directory element dialog box will open, in which you need to make the necessary changes, and then press either the key "OK"(information will be recorded and the window of the edited element will close), or "Record"(information will be recorded, but the window of the element being edited will remain on the screen).


For some directory details, it is necessary to store the history of changes in their details. Viewing the history of periodic details can be done by placing the cursor on the corresponding element in the directory list and clicking on the button "Go" and selecting the appropriate information register.


5.4. Subordinate directories

The 1C: Enterprise system has a mechanism for supporting subordinate directories. This mechanism allows you to link elements of different directories with each other. In a subordinate directory, each element is associated with a specific element of the directory - the owner. If the directory has subordinate directories, then to open it you need to use the menu item "Actions - Go" and indicate the type of subordinate directory.



When opening a subordinate directory, a list of elements subordinate to the element on which the cursor is currently located is shown:



For hierarchical directories, the list of subordinate elements can be shown only for elements that are not groups. If, at the time of calling the subordinate directory, the cursor was on a group of elements, the following message will be displayed:

5.5. Search for directory items

With a large amount of information included in the directory, it often becomes necessary to search for the element that is needed at the moment. There are several ways to do this:

? Quick search. To perform a quick search, you simply need to type the desired value on the keyboard. When the first character entered is detected, it is displayed in a frame at the bottom of the column, and the cursor is placed in the list cell whose first characters match the entered ones. The last character entered can be removed from the search bar by pressing Backspace. If the search is carried out in a hierarchical directory, which is presented in the form of a hierarchical list, then the search is performed only in the current group of the directory. To search the entire directory, you must disable the mode of viewing the directory in the form of a hierarchical list.

The mode has the most extensive capabilities random search. It allows you to search by any value and in any direction. Random search is designed to search a list for a specific value of one of the data types existing in the system. To start the search, select "EditFind" or press the button

on the main toolbar of the program. The form of the dialog depends on the type of data in the column for which the search is being made.



¦ Indicate the information you need to find.

¦ Switch "Forward - Back - Everywhere" allows you to set the search direction.

¦ Option "By current column", if enabled, indicates that the search will be performed only in the current column of the tabular part - the one in which the cursor is positioned. When the option is disabled, the search will be performed in all columns from left to right.

¦ Option "Match case", allows you to specify whether uppercase and lowercase letters will be distinguished when searching against a string value. If this option is enabled, identical uppercase and lowercase letters will be considered different characters.

¦ After completing all the necessary settings, press the button "Search".

If there are several values ​​specified as a search pattern in the list, you can continue the search with the same settings by selecting "EditFind Next", "EditFind previous" or use the buttons

main program toolbar .

In addition, there is a special selection field on the toolbar for entering a search string, that is, you can search by string without calling the search dialog. Several previous search values ​​are also stored here, which can be selected with the button

To use this element, enter the required line information into it and press the key ENTER. If the next time you try to find the typed text, a warning appears on the screen "String not found", this means that there is no data in this direction containing the specified text.

5.6. Selection and sorting of directory elements

To configure selection and sorting of the list in the command panel, select “Actions – Set selection and sorting of the list.”



This menu item and button may not be available if the user is not given the opportunity to set the selection independently.


Tab "Selection"

Some lists provide the ability to select data based on the values ​​of the details. This allows you to view only those data that have a specific value in the attribute selected for selection. Data selection is carried out according to a specific set of selection criteria.

Types of selection are criteria that are determined at the configuration stage, and also depend on the type of list.

Selection can be carried out for several types at once. To do this, just check the box to the left of the name of the selection type.

For each species, a selection condition is selected. The composition of possible conditions is determined by the data type.

Depending on the selected type of condition, selection values ​​are entered (a specific value or range of values ​​can be specified, as well as a list of possible values, and in the conditions you can select both inclusion in the list and non-inclusion in the list).

The selection value can be any of the available values ​​of this attribute, for example, “Private person”. The type of selection and the value of selection constitute the condition of selection. There can be only one selection condition at a certain point in time.

Note that the possibility of selection is provided for most lists, and according to one or more details. If selections are not provided for the list, then the menu and toolbar will not contain interface elements for managing selections.

Selected selection parameters can be saved for future use. To do this, click the button "Selections".

When you set a selection, only elements that satisfy the selected selection condition are displayed in the list form window.

The selection of data in a list can be set in several ways.


“Sorting” tab

On the bookmark "Sorting" the order of presentation of the selected data is established.

The list on the left contains the details by which sorting will be carried out. The sorting direction (ascending or descending) is specified by the button with two arrows.

Details are transferred from the right list.

If several details are selected, the order in which they appear in the list affects the order in which the information is presented. First, the selected list will be sorted by the first attribute from the top, then each group of identical values ​​will be sorted by the second attribute from the top, etc.

5.7. Using directory elements

As already mentioned, in addition to viewing and editing, the directory can be opened to select the desired element from it. In this case, the directory is opened using the selection button

or the F4 key when entering details of the “directory” type.


A directory window opened in selection mode may have a slightly different appearance than when it is open for viewing and editing. The composition and arrangement of the directory columns may be different; as a rule, there is no group tree, and so on.

Despite the fact that the selection form is intended mainly for selecting the required directory element, in this form it is possible to perform the same actions as in the viewing and editing mode - add new elements to the directory, edit the details of existing elements, transfer elements to other groups (if the window has a group tree), and the like. For example, when filling out the “Invoice for payment” document for a new buyer, the “Counterparties” directory, opened in selection mode, will not contain the required organization, but it can be added to the directory directly in selection mode, and after recording in the directory, it can be selected into the document . If an invoice is issued to a customer already in the database, but in the “Counterparties” directory open for selection, an error is found in the name or other details of the counterparty, it can be corrected directly in the selection mode, and then the already corrected value can be selected for the document.

Selecting an element from a directory open for selection is carried out as follows:

It is necessary to place the cursor in the line with the desired element

Press the ENTER key or the item selection button

directory toolbar (if provided when creating the configuration).


In order to clear the value of a field filled in with a selection from the directory, you should:

Place the cursor in the field to be cleared

Press keyboard shortcut SHIFT+F4 or select menu command "EditClear".

5.8. Directory "Counterparties"

A counterparty is a general concept that includes suppliers and buyers, organizations and individuals.

An organization that has several of its own legal entities (holding) can act as a counterparty. In this case, the holding’s parent organization, as well as all legal entities that are part of the holding, are entered into the “Counterparties” directory. For all counterparties that are part of the holding, the flag is set "Part of the holding" and the parent counterparty is indicated - the parent organization of the holding. For the main counterparty flag "Part of the holding" not installed.

Counterparties can be grouped by directory classifier groups, for example, "Suppliers", "Buyers" And "Implementers". The directory of counterparties has an unlimited number of nesting levels.

On the bookmark "Are common" should be specified:



? Legal entity/individual– counterparty status.

? Group of counterparties– the counterparty belongs to the group.

? TIN– identification number of the counterparty, to be reflected in printed forms of documentation

? Part of the holding– a sign that the counterparty is part of the holding and for it it is necessary to indicate the main counterparty

? Head contractor– parent organization of the holding

For a legal entity:

? Full name - the name of the counterparty to be reflected in printed forms of documentation, in the name attribute you must write the name so that it can be easily found using a quick search. For example: Fedorov PE is the name, and PE “Fedorov certificate 333” is the full name.

? checkpoint - registration code for reflection in printed forms of documents

? OKPO code

For an individual:

? Full name– last name, first name and patronymic

? Document– document proving the identity of an individual.


On the bookmark "Contacts":

In the table "Addresses and telephone numbers" contact information of the counterparty is provided. Displays both completed types of contact information for a given counterparty, as well as those that are not filled out, but are entered into the directory "Types of contact information" for objects of the “Counterparty” type. For each type of contact information, you can view the history of its changes by clicking on the button "Story" table command bar.

In the table "Contact faces" contact persons of counterparties are displayed. The list of contact persons can be edited.



Bookmark "Accounts and agreements":

On this tab, the bank accounts of the counterparty and agreements concluded by the enterprise with the counterparty are edited.

The main agreement and current account are marked in bold, which can be changed using the corresponding buttons on the command panels “Set as primary.”


5.9. Directory "Nomenclature"

Directory "Nomenclature" is intended for storing information about goods, kits, kits, products, returnable containers, materials, services, construction projects, equipment. There is no strict division into such categories; only services and sets are distinguished. The categories of what is returnable packaging, materials, products are determined at the time the item arrives at the enterprise.

When describing an item item in the help system, in addition to the name, it is necessary to define a number of additional properties. Some of them will be used in the future as default values ​​when substituting into document details, i.e. Such properties are not set rigidly and can be overridden at any time:


? Short title. Used to select and quickly search for items from the list.

? Full name. Used, for example, to print documents. For example: Yorgut “Bio double benefit” strawberry rosehip 480 g is the full name, Bio 2 benefit, strawberry spike.480 yoghurt is the name for quick search.

? Nomenclature group. A link to the “Nomenclature” directory group to which the element belongs if a hierarchical structure is specified in the directory. When you manually change the parent, the element is transferred from one group to another.

? Type of nomenclature. Pointer to enable inventory control.

? Unit. Each item in the nomenclature is characterized by a basic unit of measurement. It is selected from the reference book “Classifier of units of measurement”.

? Customs declaration, Country of origin, VAT rate. Details whose value will be used in the system as a default value when issuing, for example, invoices.

At the directory "Nomenclature" there are subordinate directories that open by button "Go" in the directory menu:

Directory "Purpose of use"– intended to indicate the intended use of special clothing, special equipment and equipment transferred into operation.

Directory "Item Specifications"– intended for storing specifications – composition of products. The specification can indicate several product names (specification output) and a list of materials required to manufacture the specified output.

5.10. Directory "Warehouses (storage locations)"

Directory "Warehouses (storage places)" designed to maintain a list of storage locations for goods.

Each directory element describes some physical storage location (hangar, site, room, etc.). Formally, goods stored in one warehouse may be the property of different organizations, but for the purposes of management accounting, the division of balances in warehouses occurs only according to nomenclature criteria.



Directory elements "Warehouses (storage places)" are used in almost all documents registering the movement of goods, and determine the storage location through which this or that movement actually took place.

Batch accounting can be carried out in the context of warehouses or for the enterprise as a whole.

The method of maintaining batch accounting is determined in the accounting parameters settings.

The configuration separates wholesale, retail warehouses and manual retail outlets.

For each warehouse (retail, wholesale and non-automated retail outlet), the type of prices at which retail sales will be carried out can be specified (“Retail price type”). The retail price type is used to automatically fill in prices in documents for retail sales of goods. When retail prices change, product balances are automatically recalculated at new retail prices.

It should be borne in mind that strict control of retail prices is carried out only when selling goods at a manual point of sale; in all other cases, price changes are allowed when selling goods at retail.

To the reference book "Warehouses (storage places)" Any number of warehouses can be entered. Information about at least one warehouse must be present.

One of the warehouses should be specified as the main warehouse in the user settings. The specified warehouse will be used by default when initially setting the details for new documents.

5.11. Directory "Banks"

To the reference book "Banks" information is entered about the banks in which the company itself and its counterparties have current accounts.

This directory contains information about the name of the bank in which the current account of the company or counterparty is opened, BIC, correspondent account, as well as data on the location of the bank, telephone numbers for contacting bank employees, index and postal address of the bank.

The directory has a multi-level, hierarchical structure. Directory elements can be regrouped by moving them from group to group.



The directory can be filled out either manually (with a small number of entered elements) or using the all-Russian classifier of banks. By clicking the button in the bank list window “Add banks from the Russian Federation classifier”, you can access this classifier, and with the first click, call up the window for updating the bank classifier from the information support disk or from the Rosbusinessconsulting website.

5.12. Directory "Currencies"

This reference book is used in all types of accounting (accounting and tax).

The currency directory initially contains two currencies: the Russian ruble and the US dollar. By default, the Russian ruble is set as the regulated accounting currency (base currency) in the configuration. In order to start working with the configuration, you need to enter the current dollar exchange rate against the ruble.

Information about the exchange rate and multiplicity of the currency is stored in the information register. By default, the list shows the values ​​​​set for the working date (“Service – Parameters – Working date”). This date is shown in the list of currencies in the “Rate Date” field. At any time, the user can change the date and view the exchange rate value for any date of interest.

You can view the dynamics of exchange rate changes by opening the currency element form for any currency in the list.

Using the standard sort and select keys, you can sort the list of exchange rates or set the period for displaying the history of exchange rates.

A new currency can be added to the directory from the all-Russian currency classifier. There is a special button for this in the list of currencies. "Selection from OKW".


This opens an all-Russian currency classifier in the form of a text file in which you can find, select and enter a new currency into the currency directory.

A new currency can also be entered by adding information to the directory "Currencies". Information about the new currency is entered in dialogue mode. When entering a new currency, the details are filled in Well And Multiplicity.


Requisites "Well" And "Multiplicity" are interconnected, the meaning of their use is as follows. If the multiplicity is set equal to one, then in the field "Well" the number of rubles corresponding to a unit of a given currency is entered (that is, the exchange rate - in the usual sense). If the exchange rate of a given currency against the ruble is very low (the accuracy is less than 4 decimal places), in the field "Multiplicity" you should indicate the number of currency units accepted for quotation (quotation unit of currency), and in the field "Well"– the amount in rubles corresponding to this number of currency units.


For example. The Italian lira exchange rate is 3.4756 rubles per 1000 liras. Then in the “Multiplicity” field we indicate 1000 (quotation unit of the Italian lira), and in the “Rate” field 3.4756.


In order to correctly formulate the name of the currency in words in print forms, it is necessary to set the parameters for the currency words.

Currency registration parameters are specified in the form of a currency element. For a currency, parameters are set for writing down the whole and fractional parts of the currency. If the fractional part in printed forms is displayed as a number, then you can set the required number of digits when displaying printed forms of documents.


For example. If the number of digits is set to 1 digit, then the amount on the document will be displayed as 150.2 euros, and if 2 digits, then 150.20 euros.


Setting the current exchange rate and changing the history of the exchange rate is carried out in the information register "Currency rates." To change data on the history of a currency exchange rate, you need to set the cursor in the currency directory to the line with the desired currency and open the currency element form.

The list of exchange rates can be edited, new entries can be entered or existing ones can be deleted. For a new entry, you need to specify two details: course and multiplicity. In order to change an already set rate, you need to place the cursor on the line with the desired entry and enter a new value for the rate and multiplicity.

Exchange rates can not only be edited manually, but also filled out automatically using this processing, you can download current exchange rates for a certain period of time. Processing is called from the directory "Currencies" when you press a button "Download courses."

In the processing dialog box, you can specify the period for which you want to download exchange rates.



Using a button "Selection" you can select those currencies from the directory "Currencies", for which courses need to be downloaded.

Using a button "Fill in" you can fill the list of currencies with all the currencies that are registered in the directory "Currencies".

Courses are loaded by pressing the button "Download". After successful downloading, information about exchange rates is automatically recorded in the information register for each currency.

Button "Clear" clears the list of currencies and their rates.

5.13. Directory "Fixed assets"

Directory "Fixed assets" is intended primarily for storing the most general information about fixed assets, which characterizes the objects themselves and does not depend on which organization the object belongs to, what state it is in at one time or another, etc.

The directory is intended for maintaining analytical accounting for individual objects on accounts:

– 01 “Fixed assets”;

– 02 “Depreciation of fixed assets”;

– 03 “Profitable investments in material assets”;

– 83.1 “Increase in property value due to revaluation”;

– 98.2 “Gratuitous receipts (GS)”

– 001 “Leased fixed assets”;

– 010 “Depreciation of fixed assets”;

– 011 “Fixed assets leased”;

Basic information that should be included in the directory includes:

? OS group

? full name

? manufacturer

? factory number

? passport ID

? Date of issue

? OKOF

? OS accounting group– you should select the category to which this fixed asset belongs. In the program, fixed assets are classified into the following groups:

v Facilities;

v Transfer devices;

v Machinery and equipment;

v Vehicles;

v Tool;

v Inventory;

v Draft animals;

v Productive livestock;

v Perennial plantings;

v Capital costs for land improvement;

v Land plots;

v Natural resources;

v Other fixed assets.

? OS depreciation group– you should select the category to which this fixed asset belongs. In the program, depreciation groups of fixed assets are classified into the following groups:

v First group (from 1 year to 2 years inclusive)

v Second group (over 2 years up to 3 years inclusive)

v Third group (over 3 years up to 5 years inclusive)

v Fourth group (over 5 years up to 7 years inclusive)

v Fifth group (over 7 years up to 10 years inclusive)

v Sixth group (over 10 years up to 15 years inclusive)

v Seventh group (over 15 years up to 20 years inclusive)

v Eighth group (over 20 years up to 25 years inclusive)

v Ninth group (over 25 years up to 30 years inclusive)

v Group ten (over 30 years old)

v Separate group (clause 1, article 322 of the Tax Code of the Russian Federation)

? Subject to depreciation– determines whether depreciation should be calculated for this object. If the “Subject to depreciation” checkbox is checked, then depreciation is calculated from the credit of account 02 to the debit of the cost account. If the box is not checked, then depreciation is not calculated, and depreciation calculated according to the norms is debited to account 010 once at the end of the year.

? Motor transport- a sign of belonging to motor transport

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: