Any new directory can be presented in the form of a table that has two columns: the code of the directory element and its name. System 1C: Enterprise, in addition to the code and name, allows you to store Additional information about a directory element. When editing a directory, you can describe a set of additional details intended for storing such additional information.

Rice. 10 – creation of new details in the “organization employees” directory.

Table parts

To describe some data related to the directory and not used independently, tabular parts are used. An example of a tabular part could be the composition of an employee’s family (data for each family member is described in the details of the tabular part, and the number can be arbitrary), the employee’s track record, etc.

Rice. 11 is an example of additional data from the directory “employees of the organization” in the tabular section.

If in the example given, information on the composition of employees’ families could be used independently, then they could be separated into a separate directory, subordinate to the “Employees” directory.

The main difference between the tabular part and the subordinate directory is that elements of the directory can be referenced, but rows in the tabular part cannot. When accessing a directory element, the entire element, together with all tabular parts, is read from the database into memory. If the table part contains a sufficiently large number of rows, this may degrade system performance. Therefore, the tabular part should be used if you do not need to store references to elements and the number of elements is unlimited.

The number of rows in the tabular section cannot exceed 100,000.

Each directory can have an unlimited number of tabular parts.

Conclusion

Thus, we can say that the directory is a list of possible values ​​of one or another document attribute (in the broad sense of the word “document”).

Directories are used in cases where it is necessary to eliminate ambiguous information input.

In the configuration, the structure of the directory is created, and its actual contents - elements of the directory - are entered by the user when working with the program.

Directories have various properties. Also, configuration developers can create a set of predefined elements and groups of elements (for hierarchical directories) for directories.

The development of accounting information technologies has been accelerating in recent years. Any practicing accountant works on a computer and cannot imagine his professional activities without the latter.

Modernization and change of generations of computer equipment, transition to new operating systems, updating versions of application programs, etc. is a characteristic feature of modern computerization. Currently, computer networks (local, regional, global) are being implemented everywhere, thanks to which remote access to network-wide resources (databases, computers, printers, fax modems, etc.) is provided.

"1C: Enterprise Accounting" helps you keep records various types commercial activities. Whatever business your organization is engaged in - wholesale or retail trade, commission trade, provision of services, production or construction - you can keep records in 1C: Enterprise Accounting. One information base You can keep records of the activities of several organizations and individual entrepreneurs. In this case, general directories of counterparties, employees and items are used, and reporting is generated separately.

Most Russian companies have already optimized the work of their accounting departments using 1C and have felt the benefits that this program provides. These are flexible accounting capabilities, automation of all areas of accounting.

Practical familiarization helped me learn about the various capabilities of the 1C: Enterprise Accounting program.

I believe that the knowledge gained is sufficient to work in the program and apply it directly.

In order to account for money and goods, various tables are widely used in business. Almost every document is a table.

One table lists the goods to be shipped from the warehouse. Another table shows the obligations to pay for these goods.

Therefore, in 1C, working with tables occupies a prominent place.

Tables in 1C are also called “tabular parts”. Directories, documents and others have them.

The query, when executed, returns a table that can be accessed in two different ways.

The first - faster - selection, obtaining rows from it is possible only in order. The second is uploading the query result into a table of values ​​and then random access to it.

//Option 1 – sequential access to query results

//get the table
Select = Query.Run().Select();
// we go through all the lines of the query result in order
While Select.Next() Loop
Report(Selection.Name);
EndCycle;

//Option 2 – uploading to a table of values
Request = New Request("SELECT Name FROM Directory.Nomenclature");
//get the table
Table = Query.Run().Unload().
//further we can also iterate through all the lines
For each Row from Table Cycle
Report(String.Name);
EndCycle;
//or arbitrarily access strings
Row = Table.Find("Shovel", "Name");

An important feature is that in the table that is obtained from the query result, all columns will be strictly typed. This means that by requesting the Name field from the Nomenclature directory, you will receive a column of the String type with an allowable length of no more than N characters.

Table on the form (thick client)

The user works with the table when it is placed on the form.

We discussed the basic principles of working with forms in the lesson on and in the lesson on

So, let's place the table on the form. To do this, you can drag the table from the Controls panel. Similarly, you can select Form/Insert Control from the menu.

The data can be stored in the configuration - then you need to select the existing (previously added) tabular part of the configuration object whose form you are editing.

Click the "..." button in the Data property. In order to see the list of tabular parts, you need to expand the Object branch.

When you select the tabular part, 1C itself will add columns to the table on the form. Rows entered by the user into such a table will be saved automatically along with the reference book/document.

In the same Data property, you can enter an arbitrary name and select the Value Table type.

This means that an arbitrary table of values ​​has been selected. It will not automatically add columns, nor will it be automatically saved, but you can do whatever you want with it.

Clicking right click on the table you can add a column. In the properties of a column, you can specify its name (for reference in 1C code), the column heading on the form, the connection with the attribute of the tabular part (the latter - if not an arbitrary table is selected, but tabular part).

In the table properties on the form, you can specify whether the user can add/delete rows. A more advanced form is the View Only checkbox. These properties are convenient to use for organizing tables intended for displaying information, but not editing.

To manage the table, you need to display a command panel on the form. Select the menu item Form/Insert Control/Command Bar.

In the command bar properties, select the Autofill checkbox so that the buttons on the panel appear automatically.

Table on form (thin/managed client)

On in a manageable form These steps look a little different. If you need to place a tabular part on the form, expand the Object branch and drag one of the tabular parts to the left. That's all!

If you need to place a table of values, add a new form attribute and in its properties specify the type – table of values.

To add columns, use the right-click menu on this form attribute, select Add attribute column.

Then also drag the table to the left.

In order for a table to have a command bar, in the table properties, select the values ​​in the Usage – Command bar position section.

Uploading a table to Excel

Any 1C table located on the form can be printed or uploaded to Excel.

To do this, right-click on an empty space in the table and select List.

In a managed (thin) client, similar actions can be performed using the menu item All actions/Display list.

Tabular parts exist for many objects in 1C:

  • Directories
  • Documentation
  • Reports and processing
  • Charts of accounts
  • Characteristic type plans
  • Calculation type plans
  • Business processes and tasks

Tabular parts allow you to store an unlimited amount of structured information belonging to one object.

Let's look at some techniques for working with tabular parts.

How to bypass the tabular part

To traverse the table part, you can use a loop For each

For each Row from the Tabular Part of the Cycle

Report(String. TabularPart attribute) ;

EndCycle ;

At each iteration into the variable Line the next row of the tabular section is transmitted. The values ​​of the row details can be obtained by the expression Line.AttributeName.

How to get and bypass selected rows of the tabular part

To display information from the tabular part of the object, use a form element Table field. To enable the ability to select multiple rows in a table field, you need to set the value Multiple at his property Selection mode.

To get a list of selected lines, use the following code:

A loop is used to iterate through the selected lines. For each:

SelectedRows = FormElements. TableFieldName. SelectedRows;

For each Row from Selected Rows Loop

//loop contents

EndCycle ;

How to programmatically select rows of a tabular part (table field) and deselect them

To programmatically deselect rows of a table field:

Form Elements. TableFieldName. SelectedRows. Clear() ;

To programmatically select all rows of a table field:

For each CurrentRow From TabularPart Loop
Form Elements. TableFieldName. SelectedLines. Add(CurrentRow) ;
EndCycle ;

How to clear the table part

TabularPart. Clear() ;

How to get the current row of a table section

The current line is the period in which the user has this moment the cursor is located. To get it, you need to access the control element on the form that is associated with the tabular part.

For regular forms the code will look like this:

Form Elements. TableFieldName. CurrentData;

For managed forms:

Elements. TableFieldName. CurrentData;

How to add a new row to a table section

Adding a new line to the end of the table section:

NewRow = TablePart. Add() ;

Adding a new line anywhere in the table section (subsequent lines will be shifted):

NewRow = TablePart. Insert(Index)
//Index - number of the added line. Line numbering starts from zero.

New line. Props1 = "Value" ;

How to programmatically fill in the details of a table row

If you need to programmatically fill in the details of a table section row that is added by the user, you must use the table section event handler When StartingEditing.

The procedure created by the handler has three parameters:

  • Element- contains a control element TabularField.
  • New line- boolean. Contains value True, if added new line tabular part, and Lie, if the user started editing an already existing line.
  • Copy- boolean. Contains value True, if the user copies the line, and Lie in other cases.

Let's look at an example. Let's say we need to fill in the details of the tabular section AccountAccount, in case a new line is added. When editing an existing line, you do not need to change the accounting account.

Procedure TabularPartAtStartEditing(Element, NewRow, Copy)

//If the user edits an existing line, then we do nothing
If NOT NewRow Then
Return;
EndIf ;

//If the line is new, set the accounting account
TechString = Item. CurrentData; //Get the current row of the tabular part
TechString. Accounting = Charts of Accounts. Self-supporting. RequiredAccount;
End of Procedure