"creation and development of a character's image." Keeping records of items by characteristics How to add item characteristics in 1C 8.3

If someone wants to describe this or that material, we must provide him with some mechanism that allows him to create any characteristics and, most importantly, indicate what type of value these characteristics should have. Then, when setting values ​​for a certain material characteristic, the user will be able to select values ​​strictly in accordance with the specified type.

This ability to describe characteristics is precisely what the configuration object provides. Plan of characteristics types, which we will now get acquainted with.

Creating New Configuration Objects

1. Create a configuration object Directory with name OptionsNomenclatures and indicate that it will be subordinate to the directory.

2. Let's create another configuration object Directory with name.

3. After this, we will create a configuration object Plan types of characteristics with name PropertiesNomenclature. The type of the characteristic value will be set as follows:

  • Number, length 15, accuracy 3;
  • Line, length 25;
  • Date;
  • Boolean O;
  • ReferenceLink.AdditionalPropertiesNomenclature.

4. Directory AdditionalPropertiesNomenclature indicate the owner → plan of types of characteristics PropertiesNomenclature.

5. On the bookmark Forms Let's set it to edit in the list.

6. After this we determine that additional meanings characteristics plans for types of characteristics will be located in the directory Additional PropertiesNomenk-latura.

7. On the bookmark Forms We indicate that this plan of characteristic types will be edited in the list.

8. Finally, let's create a configuration object Register of information with name Nomenclature Property Values.

9. Case changes:

  • Set of Properties, leading , type ;
  • ViewProperties, type Plan of Types of Characteristics Link. Properties of Nomenclature.

10. Register resource:

  • Meaning, type Characteristics.PropertiesNomenclature.

Note that we are able to define the type of a register resource value as Characteristic.<имя> . Essentially, this definition is composite type data as specified in the value type of the corresponding characteristic type plan. That is, a register resource can have a value of any type from those described in the value type of the characteristic type plan.

Finalization of the Nomenclature reference book

1. First of all, in the directory we need to provide the ability to edit a version of the material. To do this, we indicate that the directory will now be edited in both ways (on the tab Form) → in the list and in the dialog.

2. Let's create element's basic shape using the constructor.

3. Let’s slightly expand the form in width and height and add a panel to it: Form in†’ Insert Control in†’ Panel(from the top menu) or using the bottom menu icon Panel. Using the cursor that turns into a “cross”, we stretch the panel, getting the following picture and at the same time a window with a question:

If the question does not appear immediately, it will appear after we slightly change the position of any of the panel borders.

4. Let’s answer this question in the affirmative, and all controls will move to the added panel:

5. Now we will adjust the dimensions of the panel and add a new page to it. Adding a page → context menu right mouse button on the form field → Add page.

6. Set the name and title new pageProperties, and rename the first page to Basic and give it the same title. Names and titles are set in the panel properties palette in the properties group Current page:

7. After this, select all the controls located in the panel and execute the command Shape in†’ Centering in†’ Center vertically.

8. Now let's go to the page Properties and add a caption InscriptionOptionsNomenclatures with title Nomenclature options:. Let's specify the font style for it Fatty.

9. Under this inscription we will place a table field with command panel. Let's give the field a name Options and type DirectoryList.OptionsNomenclature.

10. Remove the column from the table field Code.

11. For this table field Options set the property Link by owner → DirectoryObject.Link.

Setting this property provides us with the following: for the data source of this field → form attribute Options, having type Directory List.OptionsNomenclature, - the value of selection by owner will always be equal to the link to the edited directory element. In other words, the directory list contained in the form attribute Set of Properties, will always contain only elements subordinate to the edited directory element. And that means the table field Options, for which this attribute is a data source, will display only elements subordinate to the edited directory element.

12. Below we will place another inscription in the same way → CaptionValuesProperties with title Property values: and font style Fatty.

13. Below it we will place a table field with a command panel. Let's give the field a name Properties and type.

14. For the column Property set let's take down the flag Visibility, and for the input field in the column Meaning establish a connection by type Form Elements.Properties.CurrentData. ViewProperties.

A type relationship will ensure that we limit the type of values ​​entered into this input field to only the type of characteristic selected in the field Property type. However, by doing this we cannot in any way influence the value itself stored in this field. If you do not take any additional actions, then when you enter into the field Meaning it will not be possible to change the type of characteristic of any value.

If you select a different type of characteristic, there will be a mismatch between the type of value being stored and the type to which input in the control is limited. In this case, naturally, the system will prompt you to enter the type that has the stored value.

To avoid this situation, when changing the value in the field, Property type give field value Meaning to the type of characteristic selected in the field Property type.

15. Therefore, for the input field in the column Property type let's create an event handler WhenChange:

16. Now we need to make sure that in the table field Properties information register entries were displayed that related only to the directory element selected in the upper table field OptionsNomenclatures.

Therefore for the table field Options: create an event handler for When a Row is Activated:

17. In addition, in order not to display the entire register when opening the form, we will create a form event handler WhenOpening containing the following text:

Finalization of the directory OptionsNomenclatures

Now we need to finalize the directory OptionsNomenclatures in such a way that the user has the opportunity to create new properties of materials not only when editing the material itself, but also in the process of entering documents, when in tabular part a set of properties is selected.

1. Therefore, for the reference OptionsNomenclatures Let's indicate that it will be edited in both ways (both in the list and in the dialog).

2. Let's create it using the constructor element's basic shape .

3. In the form we will need to place table field , which should display existing entries in the property value information register for this directory element.

In the main form of the element we will place a table field with the name Properties, type Information RegisterList.Values ​​of Nomenclature Properties and command panel.

4. For the column Property set remove the visibility flag.

5. Then for the input field located in the column Meaning, let's set the connection by type Form Elements.Properties.CurrentData.ViewProperties.

6. For an input field located in a column Property type, let's create an event handler WhenChange:

Now we need to make sure that when we open the form, the selection we need is installed. It is also necessary to ensure that when adding a new directory element, the selection is established after the element is recorded. To do this, we will use the assignment option data change event handler , which will track changes in the link to the edited directory element.

7. First of all, let's create an event handler WhenChangingLinks, in which we establish the selection we require:

8. Then add a call to this handler to the body of the form module:

9. And in conclusion, it is necessary to provide for the possibility that the user can begin to set new property values ​​without having yet written down the directory element itself Property Sets. Therefore, let's create a table field event handler BeforeBeginAdditions:

Finalization of the register of Remaining Materials

To ensure that materials are accounted for according to their characteristic values, it is necessary to change the structure of the accumulation register Remaining Materials and add a new dimension to it Set of Properties with type DirectoryLink.OptionsNomenclature.

Finalization of the document Receipt Invoice

The last thing left for us is to finalize the document Invoice. So that when goods arrive, the user can specify a set of properties for each incoming material.

1. Add a new attribute to the tabular part of the document Set of Properties with type DirectoryLink.OptionsNomenclature:

2. Place this detail in the table field of the document form ( right button mice → Data placement):

3. For an input field located in a column Set of Properties, let's use the property again Link by owner →Form Elements.Materials.CurrentData.Ma-

terial. Now, when you select in this input field, a list of directory elements will always open OptionsNomenclatures, subordinate to the material selected in the column Material.

4. In conclusion, we will open the procedure for processing the posting in the document module and add to the generated movements the assignment of a value to the dimension Set of Properties:

Now let's launch 1C:Enterprise in debug mode and create several sets of properties for our materials.

Creating Property Sets

1. Open the directory element Nomenclature → Electric cable.

2. Let's go to the bookmark Properties and create a set of properties for this element called White.

3. Then we will create a set of properties for the directory element Nomenclature → Rubber hose. This set of properties will be called Poland and consist of the following characteristics:

  • Color → Chain;
  • Manufacturer → Fagumit.

4. Now let's open the document Receipt invoice No.–2 and indicate that 2 white electrical cables and a Polish rubber hose were purchased.

5. Then copy the first line of the document and indicate that 3 black electrical cables were also purchased. During the input process we will have to create another set of properties for the electrical cable → Black, which has:

  • Color → Black;
  • Section → 2.5.

6. Let’s check the document and look at the document’s movements in the register Remaining Materials:

7. In addition, let's look at the entries contained in the information register Nomenclature Property Values:

Report of Material Remains by Properties

To complete the picture, we will create a report that will show us the availability of materials with certain properties.

When creating this report, we use the capabilities that the data composition system provides us with to work with characteristics.

1. Create a new configuration object Report with the name Remaining Materials by Properties.

2. Open the data composition schema designer, add a new Dataset → query and let's start constructing the request.

3. Select the virtual table of the accumulation register Remains of Materials. Remains and About the Company.

4. From the virtual table of the accumulation register Remaining Materials. Remainings and Turnovers select the following fields:

  • Material;
  • PropertySet;
  • QuantityInitialRemaining;
  • QuantityIncoming;
  • QuantityConsumption;
  • QuantityFinalRemaining.

5. After that, on the tab Unions/Aliases let's set aliases for numeric fields without a word Quantity:

6. Let's start describing the characteristics. To do this, go to the bookmark Characteristics.

Click on the button Add and let's start describing the fields.

7. The first field that needs to be described is Value type. Here we should indicate the type of the field to which our characteristics will relate. In our case, such a field is the field Set of Properties register Remaining Materials. Therefore, we will choose as the value type DirectoryLink.OptionsNomenclature.

8. The next step is to describe where the data composition system should obtain the list of characteristics. To do this, you should indicate the source of the list of characteristics and describe the purpose of specific fields of this source.

As a source, the data composition system can use either an existing source data table or the result of some query on the tables. In our case, everything is quite simple: the list of all characteristics is stored in terms of types of characteristics PropertiesNomenclature. Therefore, we will indicate as a source Table, and in the field List of characteristics let's choose Plan of Types of Characteristics. PropertiesNomenclature.

9. Next, you should describe the purpose of the fields of the source that “supplies” the list of characteristics. In the field Identifier let's choose Link, in the field Name → Title, and in the field Type → ValueType.

10. Let's move on to describing the source of characteristic values. In our case, the source of characteristic values ​​is the information register Nomenclature Property Values, so in the field Source we choose Table, and in the field Characteristics valueInformation Register.Values ​​of Nomenclature Properties.

11. Next, we will describe the purpose of the register fields. In the field Object select a dimension Set of Properties, in the field Identifier → ViewProperties, and in the field Meaning→ register resource Meaning:

12. This completes the creation of the request. Click OK and look at the request text generated for the data composition scheme:

13. B this request notable is the section starting with keyword CHARACTERISTICS. It describes exactly the characteristics of the data composition system that will be used in this report.

The text of this section is contained in braces . This means that it is not part of the query, but rather an instruction to the data composition system.

14. Let's start editing the data layout diagram. First of all, on the tab Resources select all available resources:

15. Let's go to the bookmark Settings. Let's create a report structure → add a grouping Detailed entries.

16. Then on the bookmark Selected fields Let's select the fields that will be displayed in the report:

  • Material;
  • PropertySet;
  • InitialRemaining;
  • Coming;
  • Consumption;
  • FinalRemaining.

17. In conclusion, let's go to the bookmark Other settings and set the report title → .

18. This completes the creation of the report. Let's launch 1C:Enterprise in debug mode and see what results can be obtained using our report. Let's open the report Remaining materials by properties.

19. First, let's see what materials we have with a cross section of 2.5 mm2. To do this, click Settings, let's go to the bookmark Selection and open the thread Property set.

Please note that the fields that exist in the directory OptionsNomenk-latura, the data composition system has added all the characteristics that we have defined for different sets properties in the database: Manufacturer, Color and Section. Thus, selection in a report based on the values ​​of any characteristics is quite simple and intuitive.

20. To find out what materials we have with a cross-section of 2.5 mm2, just select the Section, mm2 field and set the equality condition to 2.5 for it.

21. When the report is completed, we will get the following result:

22. Then let's see what black materials we have:

23. And finally, to make sure that the report works correctly, let’s see how many black electrical cables we have:

Thus, you are convinced that when using this logical diagram, we now have the opportunity to keep track of materials in an arbitrary number of sections of properties and their values.

It should be noted that the example we considered is not a complete solution for this configuration. We just demonstrated the possibility of maintaining such records. In order for our configuration to fully use the properties of materials, it is necessary to make appropriate changes to the remaining registers, documents and some reports.


They find us: plan of characteristics types, obtaining data from a characteristic type plan.

Share