Fast. Subordinate directories. Quickly 1c enterprise as an owner's guide

Continuation of a single topic, answers to Radchenko's book, lessons 2 and 3.

What is the "Subsystem" configuration object used for?
The subsystem is the main element for building the 1C: Enterprise interface. Subsystems allocate functional parts in the configuration, into which the applied solution is logically divided.

How to describe a logical structure using Subsystems?
By dividing it into functional parts, which are separate subject areas.

How do I control the order in which subsystems are displayed and displayed in a configuration?
Right click on the configuration, select the command "Open the configuration command interface", you can change positions using the arrows.

What is the configuration object editing window and how does it differ from the properties panel?

Editing window - mainly used for creating new objects.
Properties palette - not tied to a specific configuration object.

Lesson 3.

What is the reference configuration object for?
The reference book is intended for working with lists of data, describing their properties and structure.

What are the salient features of the Directory Configuration Object?
The directory consists of elements; Each element is a separate record in the table that stores information from this directory;
The element can also contain additional information that describes in more detail this element - the same for all elements of the directory - the attribute; Props are also a configuration object;

What are the requisites and tabular sections of the reference book used for?
Attributes are used to describe additional information describing a directory element;
The tabular part is used to describe the information of the directory element, which is the same in structure, but different in quantity.

Why do we need hierarchical directories and what is a Parent?
Hierarchical directories are needed to group the elements of the directory according to any characteristic or principle. Several types of hierarchies are distinguished: hierarchy of groups and elements - a directory element representing a group - a parent for all elements and groups included in this group;
Element hierarchy - the parent is not a group of directory elements, but the element itself.

Why are subordinate directories needed and what is an Owner?
Elements of one catalog can be subordinated to elements of another catalog, and in this case a one-to-many relationship is established. One-to-one relationship can also be used, when each item of the subordinate catalog is associated with one of the items of the owner catalog.

What are the basic forms of the reference book?
Element form - for editing or creating a catalog element;
Group form - for editing or creating a directory group;
List form - to display a list of items in the directory;
Group selection form - to select one of the directory group;

What are predefined catalog items?
Directory items created in the Designer cannot be deleted by the user; They serve to store information always, regardless of user actions;

How does a regular element differ from a predefined one in terms of configuration?
Algorithms of the configuration can be tied to predefined elements, therefore, the system adds these elements to the database structure itself, without user intervention.

How can a user distinguish a regular element from a predefined one?
Using the pictogram

How to create a reference configuration object and describe its structure?
Create a new reference - structure - on the tabs hierarchy, data, pictures here

How to add a new element to the catalog?
Through the 1C: Enterprise mode.

How do I create a directory group?
Through 1C: Enterprise mode

How do I move an item from one group to another?
Right click on an element, "move to group"

Why is the basic configuration and database configuration needed?
The main configuration is the configuration for the developer. Database Configuration - for working with users.

How to change the configuration of the Database?
No way. You can only upgrade to a basic configuration state.

How are configuration objects and database objects related?
Configuration objects describe storages, tables. And the objects of the Database are records that are contained in these tables.

What are subordinate configuration objects?
Details, tabular sections, etc.

Why is it necessary to check the filling of the requisites in the directory?
To prevent the user from entering the network with empty or incorrect entries.

What is quick pick and when to use it?
To select items not from a separate form, but from a drop-down list filled with items from this directory.

How to display a reference and define its presentation in different sections of the application interface?
To display - right click on the reference, the "Modify" tab, the "Subsystems" tab.
Directory view - "General" tab, then General - subsystems - all subsystems. here drawings

How to display the commands for creating a new catalog item in the subsystem interface?
General - subsystems - all subsystems - checkbox "Nomenclature: create"

How to edit the command interface of a subsystem?
General - Subsystems - All subsystems. Above - the "Command interface" field

What are the standard panels used in the application interface, and how to configure the location of these panels in the configurator and in the 1C: Enterprise mode?

Sections panel; the command panel of the current section (if they are specified; contains commands corresponding to the selected section; at the beginning of the panel there are commands that allow you to open any lists, and then commands that allow you to create new data items, generate some kind of report or perform processing); toolbar and info panel (favorites bar, history bar, open bar ...).
The arrangement of these panels in the configurator is configured as follows:
Select the root of the tree of objects of our configuration, by pressing the right mouse button we will open the context menu and select the "Open client application interface" item. In the window that appears on the right, there is a list of all standard panels of the applied solution. By dragging them to the left side of the window or deleting them from there, we will configure the desired display of the panels.
Setting up the location of these panels in the 1C: Enterprise mode is done as follows:
Main menu -\u003e View -\u003e Customize panels -\u003e Select and drag the mouse to customize the desired display of the panels.


V. V. Klyuev

http://prof1c.kklab.ru

Subordinate directories

Most likely, you have already repeatedly noticed in the usual typical configurations interconnected directories, when when you select a directory element (directory1), the value of another directory (directory2) is "filtered" by this value - that is, values \u200b\u200bare selected that belong only to the current directory element1; for example, it is the Directory "Departments" owned by the Directory "Organizations".

In order to immediately grasp the essence of what is happening, let's see 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.

Reference1 and Reference2. In reference2, go to the "Owners" tab and select the owner - "Reference1", see as shown in the figure.

Now, when creating items in the "Directory2", the system will ask you to enter the owner of the directory1. There is an option - Use subordination - when specifying subordination to Elements, groups, or groups and elements.

It would seem that everything is simple, but users have problems. When opening the "Directory2", the user sees all the elements in a completely incomprehensible order, and besides, if you worked with typical configurations, you might have noticed that you do not specify the owner anywhere in the "Subdivisions" directory directly, and when opening the directory you can choose organization and, depending on this, receive elements subordinate to one or another organization; at the same time, when creating an element of the directory "Departments" by default, you will receive the owner that you have selected in the form of the list of departments.
So let's start and create a "List Form" for our "Directory2", for now, provide this to 1C without making any changes, later we will correct the form created by the designer.
In "Reference2" go to the Forms tab and add (+) a new Reference List Form and click Finish.

Let's create a form attribute with the "Reference1.Link" data type, named "SelectionReference1", and drag this attribute onto the form, set the title "Reference1".


Now, in order for "this miracle" to work, you need to write a code that will perform a selection when you select a Directory Item1.

8.2, 8.3 Managed forms

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

In the procedure, enter the following text:

& AtClient Procedure SelectionReference1OnChange (Item) List. Selection. Elements. Clear (); // SelectionItem \u003d List. Selection. Elements. Add (Type (" DataCompositionSelectionElement")); SelectionElement. LeftValue \u003d NewDataCompositionField (" Owner "); SelectionElement .ComparisonView \u003d DataComparisonView. Equal; SelectionElement. Usage \u003d True; SelectionElement. RightValue \u003d SelectionDirectory1; SelectionElement .IndexDisplay Mode \u003d BackdropDisplay Mode;

8.2 Common forms


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

Procedure Reference1OnChange (Item) ThisForm. Selection. Owner. Value \u003d Directory1. Link; This Form. Selection. Owner. Usage \u003d True; This Form. Elements of the Form. Reference List. Customizing Selection. Owner. Availability \u003d False; // (?) EndProcedure

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

Video (no sound - everything is clear without sound)

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

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

What are 1C reference books for?

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

The automated system allows you to make a list once, into which this very product is then entered. If necessary, you can always indicate the necessary data, characteristics and other information in the description. It turns out that 1C directories are ready-made lists with data about goods, customers, services, etc. If necessary, the lists can be changed and supplemented.

Where are the 1C directories?

Usually, the interface of work in 1C Enterprise is developed by a programmer, which means that various directories can be in completely different menus.

In a thick client, a user with administrator rights is able to open any 1C document and has access to any reference book. To do this, you need to open the "operations" menu, click on the "reference books" and select the required one from the proposed list.


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

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

What form do 1C directories have?

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


When you open a group, you are presented with a list of all the elements. And after clicking on the element itself, the reference form will become available, the fields in which you can fill in and change.

Most often in 1C Enterprise, two mandatory fields are allocated for reference books:

    The name of the reference book.

They are designed to help distinguish some elements from others. Sometimes programmers disable these options, but this is extremely rare.


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

Purpose of directories

The reference book stores a list of possible values \u200b\u200bof one or another object or attribute. References are used when it is necessary to exclude ambiguous ccod information. For example, in order for the buyer, seller, storekeeper and director to understand what kind of product they are talking about, everyone should call it the same. And in this case, we need a reference book. Usually in a trading enterprise, it looks like a price list.

System 1C: Enterprise 8 allows you to maintain an almost unlimited number of necessary reference books. Each directory is a list of homogeneous objects: positions, employees, customers, 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, not the reference itself, like a list of values, is created, but a template for the reference, its template. In the process of configuration, the structure of information that will be stored in the reference book is described, the screen and, if necessary, print representation of the reference book is developed, various features of its behavior are set.

Directory details (fields)

Each directory has as mandatory requisites Code and Name... The catalog item code can be either numeric or text. The 1C: Enterprise 8 system provides ample opportunities for working with the codes of the directory elements: automatic assignment of codes, automatic control of the uniqueness of the code and others.

In addition to the Code and the Name, the 1C: Enterprise system directories can store any additional information about a directory element. To store such information, additional details (fields) can be created in the reference book. Using the mechanism of the reference book details, it is easy to organize, for example, an employee card index. For example, the Employees directory will almost certainly have the requisites Position, Salary, Date of Admission, and others. The 1C company anticipated the programmers and introduced two mandatory (predefined) attributes into all directories: Code and Name. Indeed, virtually any object in real life contains these attributes. For example, for employees, the code is the personnel number, and the name is the last name, first name and patronymic (full name). In addition, the use of codes (when using automatic numbering) makes it easy to understand which item was entered earlier and which later in the database.

Data types

For each reference book attribute, you must specify the 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 attribute Position has the data type Positions. In this case, the values \u200b\u200bof this variable will be selected from the Positions lookup. This is how the simplest connection between directories is realized, when the values \u200b\u200bof the attributes 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 lines of the directory will be divided into 2 types: "simple" elements of the directory and groups of the directory. Groups allow you to go to the lower levels of the multilevel reference book. The use of multilevel directories allows you to organize the entry of information into a directory with the required level of detail. Elements and groups of elements in a multilevel directory can be transferred from one group to another.

Subordinate directories

A subordination relationship can be established between directories. In terms of relational databases, a one-to-many relationship is established between tables. In this case, each element of the subordinate catalog will be associated with one of the elements of the owner catalog. Sometimes we can say that elements of one catalog belong to elements of another. For example, the system may contain a directory of the Agreement. Then it can be made subordinate to the Clients directory. This means that the client owns the contracts and one client can have several contracts.

Tabular parts

Starting from version 1C 8.0, the platform has implemented the ability to specify one or more tabular sections for a reference book element. It is recommended to use this feature to reflect information associated with a given element, but which does not have its own entity (for which it is recommended to create subordinate directories). For example, for the Employees directory, the tabular sections Education and Family Composition can be created. Working with tabular sections is similar to working with subordinate references, except that tabular sections cannot be used as attribute values \u200b\u200bof other objects.

Where is the program code used to work with directories?

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

1. Reference to the reference

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

Employees \u003d Directories. Staff ; // or option 2
Positions \u003d Directories ["Positions"];

2. Creation and recording of a new element of the directory

NewEl \u003d Reference books. Staff . CreateElement ();
NewEl. Name \u003d "Petrov Petr Petrovich";
NewEl. Salary \u003d 25000;
NewEl. Write (); // it is at this moment that writing to the database occurs

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

New \u003d Directories.Employees... To create a group ();

New Write ();
// or option 2
New \u003d Directories ["Employees"]. To create a group ();
New Name \u003d "Working";
New Write ();

4. Search for a directory item

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

FoundSotr \u003d RefSotr. FindByCode (123); // search by code
FoundSotr \u003d RefSotr. FindByDesign("Ivanov Ivan Ivanovich"); // by name
FoundSotr \u003d RefSotr. FindByProps("Salary", 5000); // by props

If FoundSotr \u003d Undefined Then
// item not found
EndIf;

5. Removing a catalog item

SprSotr \u003d Directories. Staff ;

Ref. Delete (); // direct deletion of the current catalog item

Ref. SetBreakRemove(True); // mark for deletion
Ref. SetBreakRemove(False); // unmark for deletion

// you can check if the item is marked for deletion
// the Deletion Mark property is of type Boolean (True or False)

Remark \u003d RefSotr. Deletion Mark; // note: this property
If Remark \u003d True Then
// the item is marked for deletion
EndIf;

6. Enumeration of elements of the directory

Sample \u003d Directories. Employees.Select();
// start iterating over the dictionary elements in a loop
// actions with the next element ...

End of Cycle;

7. Parent. Iteration of elements within a group

A group in terms of 1C is a "parent".

SprSotr \u003d Directories. Staff ;
GroupWorkers\u003d Demand FindByDesign("Working");
Sample \u003d Demand Choose ( GroupWorkers);
While Sampling. Next () \u003d 1 Cycle

Report ("Employee" + Selection. Name);
End of Cycle;

8. Owner. Enumeration of the elements of the catalog belonging to an element of another catalog.

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

Sample \u003d Directories. Tax incentives... Select (, Employee); // employee here - link to the employee directory element
While Sampling. Next () \u003d 1 Cycle
// actions with the next element
Inform ("benefit" + Sample. Name);
End of Cycle;


9. Transaction

When creating a set of catalog items, to speed up the work, you can enclose the loop in a transaction. In this case, the real creation of all elements will occur only on the command CommitTransaction (). When using transactions, the action will either be completed in its entirety (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 the banking industry. After all, no one wants that when sending money, they are safely debited from your account, but due to some failure they did not reach the addressee.

SprSotr \u003d Directories. Staff ;
StartTransaction();

For Nom \u003d 1 By 100 Cycle
New \u003d Ref. CreateElement ();
New Name \u003d "New" + String (Nom);
New Write ();
End of Cycle;

CommitTransaction();

abstract

on the topic: "Directories hierarchical and subordinate in the 1C: Enterprise system"

Completed: student of group 230105 3 course

D.G. Kravets

Checked by: N. N. Shemyakina

Content

Introduction

1. Purpose of directories

2. Hierarchical directories

3. Subordinate directories

Conclusion

application

Bibliographic list

Introduction

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

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

1. "Accounting" - designed for accounting based on accounting transactions. Provides the maintenance of charts of accounts, entry of transactions, receipt of accounting totals, reporting.

2. "Calculation" - designed to perform complex periodic calculations. Used for calculating wages of any complexity, settlements on securities, etc.

3. "Operational accounting" - designed to account for the availability and movement of funds in a variety of aspects in real time. It is used for accounting of inventories, mutual settlements with contractors, etc.

Configurations are focused on the automation of a certain area of \u200b\u200beconomic activity and comply with the adopted legislation, operate on the basis of appropriate technological platforms.

In the 1C: Enterprise system, many tools, controls and various objects are implemented to solve automation problems and achieve certain results of the program. The system already has some built-in functions, they are supported in any kind of delivery of the system. One of these functions is the mechanism for supporting directories, or the directories themselves, which will be considered in this abstract.


1. Purpose of directories

A reference book is a list of possible values \u200b\u200bof one or another variable. Directories are opened using the Directories menu item. The complete list of directories can be opened using Directory Operations. A directory is a tree-structured list. Each object has its own unique code, name and other necessary indicators. A separate window is opened for each reference book. In the left part of the window a tree of groups is displayed, in the right - a list of objects of the current group. Reference books are used when it is necessary to exclude ambiguous information input. For example, in order for the buyer, seller, storekeeper, director to understand what product is in question, everyone should call it the same. And in this case, a reference is needed. Usually, in a trading enterprise, it looks like a price list, and if such a directory is stored on a computer, then all possible nomenclature of goods with which the trading company works 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 an element of the directory.

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

Each directory has a Code and a Name as mandatory details. The catalog item code can be either numeric or text. The 1C: Enterprise system provides ample opportunities for working with the codes of the directory elements: automatic assignment of codes, automatic control of the uniqueness of the code, and others.

In addition to the code and name, the 1C: Enterprise system directories can store any additional information about the directory element. To store such information in the directory, a list of details can be created. Using the mechanism of the reference book details, it is easy to organize, for example, an employee card index. For example, the Employees directory will almost certainly have the attributes Position, Salary, and others. The 1C company anticipated the programmers and introduced two predefined attributes into all directories: Code and Name. In reality, almost any object in 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 dictionary 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 attribute Position has the data type Positions. In this case, the values \u200b\u200bof this attribute will be selected from the Positions lookup. This is how the simplest link between the dictionaries is realized, when the values \u200b\u200bof the attributes of one dictionary are selected from another dictionary.

2. Hierarchical directories

The list of directory elements in the 1C: Enterprise system can be multi-level. In this case, all lines of the directory will be divided into 2 types: "simple" elements of the directory and groups of the directory. Groups allow you to go to the lower levels of the multilevel reference book.

The use of multilevel (hierarchical) directories allows you to organize the entry of information into a directory with the required degree of detail. Elements and groups of elements in a multilevel directory can be transferred from one group to another.

3. Subordinate directories

Any reference book can be used either by itself or be subordinate to some other reference book. 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 "Subordinate" field, select the name of this directory. Such a directory in the 1C: Enterprise system is called the owner.

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

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

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

If you open a subordinate catalog without selecting the owner element, then no element will be displayed in the subordinate catalog window, 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 catalog will be displayed in the subordinate catalog window, that is, items repaired by different owners will be shown alternately. Nevertheless, any element of the subordinate catalog “knows” its owner: if the “Edit in dialog” mode is enabled for the catalog, the name of the owner element will be displayed in the title of the catalog element editing window.


Conclusion

In the 1C: Enterprise system, many tools, controls and various objects are implemented 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 kind of delivery of the system. One of these functions is the mechanism for supporting directories, or the directories themselves, which are considered in this abstract.

In the abstract, the basic concepts of directories, their purpose in the automation system and their types were given, 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. There are also examples of using directories that may be encountered in the course of the work of an enterprise and considered the basic principles of creating and working directories in the 1C: Enterprise system.


application

Figure 1. Form of the reference book element.


Figure 2. Form of the directory list.

Below are the basic programming examples for working with reference books in the 1C: Enterprise system.

Demand \u003d CreateObject ("Directory.Employees");

SprDolzh \u003d CreateObject ("Directory. Positions");

Creating and writing a new item

Ref.New ();

RefSotr.Name \u003d "Ivanov Ivan Ivanovich";

Demand Salary \u003d 5000;

Ref.Write ();

Deleting a catalog item

 

It might be helpful to read: