How to create a new directory in 1C. Subordinate directories. Fast. Creating and recording a new directory element

Abstract

on the topic: “Hierarchical and subordinate directories in the 1C: Enterprise system”

Completed by: student of group 230105 3rd year

D.G. Kravets

Checked by: N.N. Shemyakina

Contents

Introduction

1. Purpose of directories

2. Hierarchical directories

3. Subordinate directories

Conclusion

Application

Bibliography

Introduction

"1C:Enterprise" is a software system for complex automation various areas economic activity: accounting, operational accounting, economic calculations. 1C:Enterprise consists of the Technology Platform and Configurations.

The technology platform is a set of different mechanisms used for automation and includes three main functional components:

1. “Accounting” – intended for maintaining records based on accounting transactions. Provides maintenance of charts of accounts, entry of transactions, receipt of accounting results and reporting.

2. “Calculation” – designed to perform complex periodic calculations. Used for calculation wages any complexity, securities settlements, etc.

3. “Operational accounting” – designed to record the availability and movement of funds in a variety of sections in real time. Used to account for inventory inventories, mutual settlements with counterparties, etc.

Configurations are focused on automation of a certain area of ​​economic activity and comply with adopted legislation, operating on the basis of appropriate technology platforms.

The 1C:Enterprise system implements many tools, controls and various objects to solve automation problems and achieve certain program results. The system already has some built-in functions, they are supported in any type of system delivery. One of these functions is the directory support mechanism, or the directories themselves, which will be discussed in this essay.


1. Purpose of directories

The directory is a list of possible values ​​of a particular attribute. Directories are opened using the Directories menu item. Full list directories can be opened using Operations-Directories. The directory is a list with a tree structure. Each object has its own unique code, name and other necessary indicators. For each directory, it opens separate window. The group tree is displayed on the left side of the window, and a list of objects of the current group is displayed on the right. Directories are used in cases where it is necessary to eliminate ambiguous information input. For example, so that the buyer, seller, storekeeper, director understand what the product goes speech, everyone should call it the same. And in this case, a reference book is needed. Usually in 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 a 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.

Each directory has a Code and Name as mandatory details. 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 of details can be created. Using the directory details mechanism, it is easy to organize, for example, an employee file. For example, the Employees directory will almost certainly have the attributes Position, Salary, and others. The 1C company anticipated programmers and introduced two already defined attributes into all directories: Code and Name. In reality, almost any object from real life 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).

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

2. 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 use of multi-level (hierarchical) 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.

3. 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, the name of the owner element will be displayed in the title of the directory element editing window.


Conclusion

The 1C:Enterprise system implements many tools, controls and various objects to solve automation problems and achieve the desired result of the program. Some functions are already built into the system; they are supported in any type of system delivery. One of these functions is the directory support mechanism, or the directories themselves, which are discussed in this abstract.

The abstract presented the basic concepts of directories, their purpose in the automation system and their types; two types of directories, hierarchical and subordinate, were considered. Subordinate directories are considered in more detail, since they are more complex in structure than hierarchical ones. It also provides examples of the use of directories that may be encountered during the work of any enterprise and discusses the basic principles of creating and operating directories in the 1C:Enterprise system.


Application

Figure 1. Directory element form.


Figure 2. Directory list form.

Below are the main programming examples for working with directories in the 1C:Enterprise system.

RefCotr = CreateObject("Directory.Employees");

RefDolzh = CreateObject("Directory.Positions");

Creating and recording a new element

Ref.New();

SprSotr.Name = "Ivanov Ivan Ivanovich";

Spr.Salary = 5000;

SprCotr.Write();

Deleting a directory element

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 file system on the 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 picture 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 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 specify the cost item for this item and its specification (for finished products), in other words, the composition.
  • Depending on the specifics of the nomenclature, the remaining sections are filled in, such as “ Alcohol products" and "Imported goods".

After you have filled out the card for the item being created, 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 prevent 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, for example, 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:

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 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 of measurement;
  • 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 tabular parts.

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 download directories to 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.

Purpose of directories

The directory stores a list of possible values ​​of a particular object or attribute. Directories are used in cases where it is necessary to exclude ambiguous entries.od information. For example, in order for the buyer, seller, storekeeper and director to understand what kind of product we are talking about, everyone must call it the same. And in this case we need a reference book. Usually at a trading enterprise it looks like a price list.

The 1C:Enterprise 8 system allows you to maintain an almost unlimited number of necessary directories. Each directory is a list of homogeneous objects: positions, employees, clients, goods, etc. Each such object is called a 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 details (fields)

As mandatory details, each directory has Code And Name. The directory element code can be either numeric or text. The 1C:Enterprise 8 system provides ample opportunities for working with directory element codes: 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, additional details (fields) can be created. Using the directory details mechanism, it is easy to organize, for example, an employee file. For example, the Employees directory will almost certainly have the details Position, Salary, Appointment Date and others. The 1C company anticipated programmers and introduced two mandatory (predefined) details into all directories: Code and Name. Indeed, almost any real-life object contains these attributes. For example, for employees the code is a personnel number, and the name is Last Name, First Name and Patronymic (full name). In addition, the use of codes (when using automatic numbering) makes it easy to understand which element was entered first and which element was entered later into the database.

Data Types

For each directory attribute, you must specify a data type, for example, “number”, “string”, “date”, Boolean (True or False). These are basic types, but complex data types can also be specified. For example, the Position attribute has the Position data type. In this case, the values ​​of this attribute will be selected from the Positions directory. This is how the simplest connection between directories is realized, when the values ​​of the details of one directory are selected from the elements of another directory.

Hierarchical directories

The list of directory elements in the 1C:Enterprise 8 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 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 subordination relationship can be established between directories. 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 you can say that the elements of one directory belong to the elements of another. For example, the system may have a Contract directory. Then it can be made subordinate to the Clients directory. This means that the client owns the contracts and one client can have multiple contracts.

Table parts

Starting from version 1C 8.0, the platform has implemented the ability to specify one or more tabular parts for a directory element. This feature is recommended to be used to reflect information related to a given element, but which does not have its own object entity (for which it is recommended to create subordinate directories). For example, for the Employees directory, tabular sections Education and Family Composition can be created. Working with tabular parts is similar to working with subordinate directories, except that tabular parts cannot be used as values ​​for details of other objects.

Where is the program code used to work with directories?

Since to execute program code we need to access the database, these pieces of program code must be placed in procedures and functions (or modules) executed on the server side. Additional information see section.

1. Link to the directory

To work with a directory from any module, you must first create a link to this directory.

RefEmployees = Directories . Employees ; // or option 2
Directories = Directories ["Positions"];

2. Creating and recording a new directory element

NovEl = Directories. Employees . CreateItem();
NovEl. Name = "Petrov Petrovich";
NovEl. Salary = 25000;
NovEl. Write(); // this is the moment when writing to the database occurs

3. Creating and recording a new directory group (for a hierarchical directory)

New = Directories.Employees. CreateGroup();

New Write();
// or option 2
New = Directories ["Employees"]. CreateGroup();
New Name = "Working";
New Write();

4. Search for a directory element

// if the element is found, then it is returned, otherwise the value Undefined is returned

FoundSotr = RefCotr . FindByCode(123); //search by code
FoundSotr = RefCotr . FindByName(“Ivanov Ivan Ivanovich”); //by name
FoundSotr = RefCotr . FindByDetails("Salary", 5000); //by details

If FoundCotr = Undefined Then
//element not found
endIf;

5. Deleting a directory element

SprSotr = Directories. Employees ;

Ref. Delete (); //directly deleting the current directory element

Ref. SetRemoveMark(True); //mark for deletion
Ref. SetRemoveMark(Lie); //unmark for deletion

//you can check if an element is marked for deletion
//the MarkDelete property is of type Boolean (True or False)

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

6. Enumerating directory elements

Selection = Directories. Employees.Select();
// start searching through the directory elements in a loop
//actions with the next element...

EndCycle;

7. Parent. Iterate over elements within a group.

A group in 1C terms is a “parent”.

SprSotr = Directories. Employees ;
GroupWorking= SprSotr . FindByName("Working");
Selection = SprSotr . Choose ( GroupWorking);
Bye Selection. Next() = 1 Loop

Report ("Employee" + Selection. Name);
EndCycle;

8. Owner. Enumerate directory elements that belong to an element of another directory.

One directory is subordinate to another directory, for example, the Tax Benefits directory is subordinate to the Employees directory.

Selection = Directories. Tax Benefits. Select(, Employee); //here employee - link to the employee directory element
Bye Selection. Next() = 1 Loop
//actions with the next element
Report ("benefits" + Sample . Name );
EndCycle;


9. Transaction

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. When using transactions, the action will either be completed entirely (all elements of the directory are created) or not performed at all (in the event of any failure, not a single new element will be created, everything will remain the same as before the transaction was started). Transactions are widely used in banking sector. After all, no one wants that when sending money, it is successfully debited from your account, but due to some failure does not reach the addressee.

SprSotr = Directories. Employees ;
StartTransaction();

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

CommitTransaction();

Working with reference books is both the foundation and framework of accounting.

Directories are intended for entering, storing and obtaining conditionally permanent information structured in the form of a tree. Reference information includes information about the founders of the enterprise, its counterparties, employees, taxes, etc. The list of directories required by the user is determined at the configuration stage. The user can change the content of the directories at will: edit, add or remove recorded information.

A list of all directories can be displayed on the screen using the menu command Operations - Directories

The simplicity of working in the 1C: Enterprise Accounting 8.2 program provokes a desire not to waste extra time on preparatory actions, but to immediately get results. Of course, you can fill out some reference book that catches your eye, or for which you have data ready. But in this case, there is a high probability that when filling it out you will need a value from another directory, which may be empty. There is nothing terrible in such a situation, but for those starting to work in the system, confusion may arise, which will lead to incorrect reflection of data in reports and samples of various analytical information. It will be much more difficult to correct missing values ​​later.

Next, the rules for filling out the main reference books will be considered, emphasis will be placed on subtle and important points when filling them out, the “do as I do” work tactic is implemented under the guidance of a teacher.
Only after filling them out can you proceed to further work.

As mentioned earlier, filling out directories is not difficult. It is more difficult to decide which reference book to start with. To do this, it is necessary to determine the structure of the organization, its composition structural divisions, number of employees and much more. If something is not yet clear, don’t worry: let’s start creating it and then add it. The following sequence of filling out the directories is suggested.

What reference books will we fill out?

Directories for keeping records of trade transactions and cash(We have already filled out some of the directories).

  • Directory "Organizations"
  • Directory "Banks"
  • Directory "Bank Accounts"
  • Directory "Counterparties"
  • Directory “Item Price Types”
  • Directory "Nomenclature"

Directory "Warehouses (storage locations)"

  • Directories for maintaining personnel records.
  • Directory "Divisions"
  • Directory "Individuals"
  • Directory "Employees of the Organization"



Top