Print (Ctrl+P)

Dynamic list

1. General information

A dynamic list is a special data type that allows you to display arbitrary information from database tables on a form. To do this, you need to specify the table from which you want to display data, or describe the resulting selection in a query language.
The mechanism is based on a data composition system and provides capabilities for sorting, selecting, searching, grouping and conditionally formatting the received data. In this case, the data source is a request, which is either generated by the system automatically (based on the specified data) or written manually by the developer.

Rice. 1. Creation options dynamic list

When creating form attributes of the type DynamicList a developer can choose two ways to form a data query:
● By specifying the main table - in this case, you just need to specify the table (Main table property) from which you want to receive data, and the system will automatically generate a query for the data (see. right side in Fig. 1).
● Manually generating a request - for this you need to set the Custom request property (see the left side of Fig. 1). After this, manual generation of a request to obtain data from the infobase will be available.
A query can retrieve data from multiple tables, so you can specify a primary table. This is so that the dynamic list can determine which data is primary and which is secondary, and can correctly select and display information, as well as provide standard commands. However, if it is impossible to determine the main table in the query, then it can not be specified, but then
the dynamic list will not provide commands related to the main table. In addition, in this case (without specifying the main table) the efficiency of obtaining data by a dynamic list will be significantly reduced.
To improve performance, it is recommended that any joins used in a custom query only to obtain additional data be made optional by using a data composition system query language extension.
For a dynamic list, which is the main form attribute, it is possible to set selection values ​​using a form parameter Selection. To do this, it is necessary that the name of the structure property located in the parameter Selection,
coincided with the name of the dynamic list selection field. In this case, the value of the structure property will be set as the right value of the selection element. If an array, a fixed array or a list of values ​​is passed as the value of an element of the Selection parameter of a dynamic list form, then a condition with the In List option is added to the selection, in the right value of which a list of values ​​is placed (to which the array and fixed array are converted).
An arbitrary query in a dynamic list can be a query in which a parameter is used to generate the value of a field, for example:

CHOOSE
CHOICE
WHEN Delivery.Coefficient = 1 THEN &Presentation
OTHERWISE Delivery. Coefficient
END AS Ratio
FROM

Moreover, if the type of the parameter value differs from the type of the object attribute (for example, Props1 has type Number, and the parameter value is type Line), then to display the field correctly, you must explicitly cast the parameter value to the desired type:

CHOOSE
CHOICE
WHEN Delivery.Coefficient = 1 THEN EXPRESS(&Representation AS String(100)) ELSE Delivery. Coefficient
END AS Ratio
FROM
Document.Delivery of Products HOW to Deliver

If the field by which selection is set is disabled using functional options, then selection by such a field is not installed, even if the selection value is passed as form parameters or selection parameter links.
Using the Dynamic data reading property, you indicate to a dynamic list the need to read data in small portions
(for more details about ways to obtain data using a dynamic list and data caching, see below). Regardless of this attribute, the following conditions apply:

● If the hierarchical list view mode is set, only the data of the current group and the data of all parent elements(without subordinate elements).
● If the tree view mode is set, only data from open tree nodes will be read.
● One-time loading of dynamic list data is not supported if hierarchical browsing is set (Display property is set to Tree) and the initial tree display is set to Expand all levels. To obtain data, as many requests to the server will be made as there are nodes in the displayed list.
Within a single data retrieval, a dynamic list reuses previously created temporary tables if the following conditions are met:
● The list batch query has no queries after the main batch query.
● The composition of temporary tables and the fields in them is unchanged from the previous execution of the batch request.

In its work, the dynamic list uses the values ​​of the following properties of metadata object details:
● format,
● editing format,
● hint,
● sign for highlighting negative values,
● mask,
● multi-line mode sign,
● sign of advanced editing,
● password mode.
When displaying and editing the selection and parameters of the data composition system, the editing format of the corresponding field is used.

2. Limitations and features

When setting selection in a dynamic list, remember that selection does not affect groups if the display mode for the dynamic list is Hierarchical List or Tree. By “groups” we mean an element of a directory or plan of characteristic types whose ThisGroup property is set to True.
Qualifications automatically applied by a dynamic list to the standard details Owner, Parent, Date, Period and ThisGroup are applied
standard means data composition systems. Selection, automatically applied by a dynamic list to key fields, can be applied both by standard means of the data composition system and by directly adding conditions to the request text IN to the fields of the main table. As a result of applying selections using layout tools, they can be applied both in nested queries and in parameters of virtual tables.

When developing dynamic lists, it is recommended to test all dynamic lists with custom queries. During the verification process, you should make sure that if a list query contains nested queries or virtual tables, and in them fields with aliases that match the aliases of the standard details Owner, Parent, Date, Period, ThisGroup or key fields are available for selection, then these fields are valid correspond to the standard details with which their nickname matches. If this is not the case, you should change the request so that they match or
the nickname was different.
If you choose to manually generate a request, then some restrictions are imposed on the request:
● Using the FIRST statement in a dynamic list query is not supported. If you need to use a selection limited by the number of records in a dynamic list, you should rework the request for generating a dynamic list in such a way that the actual content of the request is placed in a subquery and limit the number of records received in this subquery. You can also use a temporary table instead of a subquery.
● Selection, sorting and grouping are not supported:

  • By details tabular parts.
  • View fields.
  • DataVersion field.
  • PredefinedDataName field.
  • Chart of accounts table type field.
  • Field Type of Movement of the accumulation register table.
  • Field TypeValues ​​of the characteristic type plan table.
  • Type field Type;
  • Field of type String (unlimited length).
  • Field of type BinaryData.

● Sorting and grouping by Subconto fields is not supported<НомерСубконто>and ViewSubconto<НомерСубконто>Tables MovementsSubconto of the accounting register.
● Grouping by fields that are query language expressions containing aggregate functions is not supported.
● When the main table is selected, the dynamic list query has the following restrictions:

  • Joins are not supported.
  • The ORDER BY section is not supported. You should use a query without a main table or set the necessary ordering through the dynamic list settings.

● If a dynamic list is displayed as a hierarchical list or tree, then an entry will not be displayed as a dynamic list unless at least one parent of that entry is displayed. In other words, to display an element of a hierarchical list, a dynamic list must also display all the parents of that element up to the top of the list. In this case, by the top of the list we mean either
the root element of the hierarchical object displayed by a dynamic list, or the element set as the ParentTopLevel property of a form table extension for a dynamic list.

Using the following tables as the main table of a dynamic list is not supported:

● A table that does not have a key that uniquely identifies each table record (a reference for object tables and a record key for register tables). However, the following tables can be set as the main table of a dynamic list (despite not having a key):

● Subconto table of the accounting register;
● all virtual tables of the accounting register, except for the MovementsSubconto table;
● tables of constant values ​​(including the Constants table);
● tables of external data sources without key fields;
● cube tables of external data sources;
● accumulation register tables:

  • revolution table;
  • balance table;
  • table of turnover and balances.

● calculation register tables:

  • table of actual validity period;
  • schedule data;
  • basic data.

● Tables of tabular parts of objects;
● Change registration tables (used in data exchange mechanisms);
● Sequence tables;
● Conversion tables (used in periodic settlement mechanisms).
● A table that is used in a query only in an outer join.

In other words, a dynamic list with the specified main table will work correctly if, as a result of executing the query,
specified as a data source, the number of rows obtained from the main table does not increase (taking into account the imposed selection). If, as a result of executing a query, the number of rows obtained by the query from the main table increases, this will lead to a violation of the uniqueness of the key of the records of the table displayed by the list. In this case, you must disable the use of the main dynamic list table.
When working with a dynamic list, you must take into account access rights to the details displayed by the list:
● Data from dynamic list columns that are marked with the Always Use property, but for which current user There is no View right. Access to data of such columns (using the CurrentData property and the RowData() method)
not possible on the client side.
● If the current user does not have the View right on a key field of a dynamic list, retrieving data from that dynamic list results in an access violation error.
For a dynamic list that displays an enumeration list, there is no option to interactively customize the list.
The composition of the columns and settings of the dynamic list are associated with the query fields using aliases of the selection fields. If an alias is not explicitly specified in a query for a selection field and the field is a system one, then the field name for the English version of the built-in language is used as an alias.
The specified relationship means that when changing (or explicitly specifying an alias for a field for which an automatic alias was used)
alias of the query field that generates the dynamic list data, the dynamic list attribute settings will be lost, the form elements will “lose” the displayed details, the dynamic list settings will become incorrect, etc.
If the data source of a dynamic list is a table (regular or virtual), which allows you to set a selection by period, then if the user sets the display period in such a dynamic list (command Set date interval...),
the specified period boundaries will be set as selection values ​​or virtual table parameters. If by means of language extension
queries for the data composition system, the names of the virtual table parameters were explicitly specified - the parameters with the specified
names. Tables for which it is possible to control the period for displaying or processing data:
● register tables (main or virtual), for which it is possible to select by period (for the calculation register - by registration period);
● main tables of documents, business processes and tasks;
● main tables of document journals;
● main sequence tables, sequence boundary tables.
The dynamic list query parameter can be an array or a list of values. However, if the parameter is a list of values, then only the first value in the list will be used as the selection value. If the dynamic list uses a query with parameters, initial installation parameter values ​​must be executed in the OnCreationOnServer handler.
When displaying dynamic list data, keep the following points in mind:
● When program change dynamic list properties do not automatically repopulate associated command bars
with this dynamic list.
● If multiple fields are grouped into a group with the grouping mode in a cell and in the grouped fields there is a field that is displayed as a checkbox, then this checkbox will always be displayed first in the resulting cell (to the left of the text).
In a dynamic list, when determining the data type for fields whose expressions include parameters, fields, or literals, the resulting type is determined by the types of the fields and literals. If the parameter value type is not included in the resulting data type, its value will be truncated.
For example, in the following example the field will be of type Number.

CHOICE
WHEN IT'S A LIE
THEN 5
OTHERWISE
&Parameter
END

If you set the Parameter parameter to a value of another type, the dynamic list for that field will receive the value 0 (the default value for the Number type).
If in such a situation you need to select a parameter of a different type, it is recommended to use the query language construct EXPRESS. For example,
if in the above example you need to pass a string no longer than 100 characters into the parameter, then you should replace the simple indication of the parameter with an expression with an explicit type cast:

CHOICE
WHEN IT'S A LIE
THEN 5
OTHERWISE
EXPRESS(&Parameter AS String(100))
END

If the arbitrary text of a dynamic list request uses parameters in the expressions of the selection fields, you should explicitly indicate the type of parameters using the construct EXPRESS. For example, instead of &Nomenclature AS Nomenclature use
EXPRESS(&Nomenclature AS Directory.Nomenclature) AS Nomenclature. Otherwise searching through the search bar may work
incorrect or produce errors.

3. Methods for retrieving and caching data with a dynamic list

When obtaining data to display, a dynamic list uses one of three methods:
1. Reading from the database is performed in chunks with a number of data elements slightly greater than the number of rows simultaneously displayed by the list (but not less than 20). Data is not cached on the server.
2. Reading from the database is done in pages of 1,000 data items. Data is being cached on the server. Hierarchical data is cached: no more than 2 pages of elements are cached for each parent. No more than 20 pages of items are cached per dynamic list. Caching will be enabled by a dynamic list for the following tables:
● Selection criteria;
● All tables of the accounting register, except for the main table and the MovementsSubconto table;
● All accumulation register tables, except the main table;
● All tables of the information register, except the main table;
● All tables of the calculation register, except the main table;
● Virtual table of Tasks by Performer;
● Tables of external sources without keys;
● Cubes from external sources.

3. Reading from the database is performed in pages of 1,000 elements. The first portion is equal to 1 page. Each subsequent portion increases by 1 page (when the end of the previous sample is reached). The closer the “view point” moves to the end of the displayed data, the larger the sample is read from the database, eventually becoming equal to all the displayed data. Data is being cached on the server. The maximum number of entries in the cache and dynamic list is 1,000,000.
Depending on what is selected by the main table of the dynamic list and what value the Dynamic reading property takes, one or another method of reading data is used:

● One of the following tables is specified as the value of the Main table property: exchange plan, directory, list of documents, document journal, plan of characteristics types, chart of accounts, plan of calculation types, business process, task, table of business process points:



● One of the following tables is specified as the value of the Main table property: the main table of the information register, the accumulation register, the accounting register, the calculation register, the virtual table of the accounting register MovementsSubconto:

● Dynamic reading property:
● Installed: method 1 is used (description of methods is given above).
● Reset: Method 2 is used (description of methods is given above).

● The Main table property contains the selection criterion table or task table by executor (Tasks By Performer):
● Key identifying a table row: Link.

● The Main table property specifies the virtual table of the information register SliceFirst or SliceLast:
● Key identifying a table row: RecordKey.
● The Dynamic reading property is not applicable.
● Method 2 is used (description of methods is given above).

● The Main table property is set to one of the virtual register tables, except those listed above:

● The Dynamic reading property is not applicable.

● The Main table property is not specified, an arbitrary query is used:
● Key identifying a table row: Number.
● The Dynamic reading property is not applicable.
● Method 3 is used (description of methods is given above).

For display, data is transferred to the client in portions, the size of which is similar to the portion size in the 1st method of reading data (described at the beginning of this section).
When you create a form that contains a dynamic list, 45 data items for each visible dynamic list are initially passed to the client (if the list has more than 45 items). If the dynamic list displays more than 45 rows, an additional server call will be made when the form is opened to retrieve the missing data items.

4. Dynamic list settings

Property List settings - clicking on the Open hyperlink opens a form for setting up the display of a dynamic list. Setting up a list is done in the same way as similar operations in a data composition system.


Rice. 2. Conditional styling of a dynamic list

When setting up a dynamic list in the configuration, the application developer has the opportunity to do the following:
● set the fields by which you want to sort;
● describe the selection of data in the list;
● specify conditional appearance settings;
● set the fields by which you want to group the data.
It makes sense to set the sorting to the developer if you are not satisfied with the default sorting installed by the system.

ADVICE. It should be remembered that poor selection of sorting fields (as well as selection and grouping of data) negatively affects the efficiency of dynamic sampling.
From the point of view of an application developer, dynamic list settings consist of several parts that are interconnected. The main property through which you can manage the settings of a dynamic list is LinkerSettings. This object contains three sets of settings that, when the system runs, determine the final settings applied to the dynamic list:
● Settings – settings created in the Configurator mode. The dynamic list property Order provides fast access to the Settings.Order property of the dynamic list settings builder, so the following constructs are equivalent:
List.Order and List.SettingsLinker.Settings.Order;
● UserSettings – these are settings that are changed by the user in 1C:Enterprise mode;
● Fixed Settings – these settings are set from the built-in language. This property also contains selection values ​​that are transferred to the form using its parameters. The dynamic list properties Selection, Options, Conditional Appearance provide quick access to the fixed settings of the dynamic list settings builder. In other words, these calls are equivalent:
List.Settings Composer.FixedSettings.Selection and List.Selection.
When creating the final settings for a dynamic list, various settings options are combined as follows:
● If any type of settings is entirely marked as custom, then the resulting settings include the custom settings
(List.ComposerSettings.UserSettings). Moreover, if any settings elements are marked as unavailable, then these settings will be placed in the resulting settings from the List.Settings Composer property. Settings.
● If any type of settings is marked as custom not entirely, but element by element, then:
● Items marked as custom will be included in the resulting settings from the List.SettingsComposer.CustomSettings property.
● Items marked as unavailable will be included in the resulting settings from the List.SettingsComposer.Settings property.
● Fixed settings (List.SettingsComposer.FixedSettings) are added to the resulting settings “as is”. At the same time, it is unacceptable that the fixed and user settings contain settings of the same name, for example, selection with the same left value in the condition.

If the dynamic list settings contain settings that are disabled using functional options, these settings will be removed from the list of available settings when the dynamic list data is retrieved.
Controlling which settings will be available to the user and which will not is done in the dynamic list settings window.


Rice. 3. Control inclusion in user settings

The checkbox at the bottom of the window (see Fig. 3) is responsible for placing the entire type of settings in the settings (normal or quick). This feature is available for selection, ordering, grouping, and conditionalization. If settings are specified with edit mode Quick selection, then in the Custom Settings Group property of the form table displaying the dynamic list, you must specify an empty form group in which elements associated with quick custom settings of the dynamic list will be located. If the group is not specified, quick user settings will not be displayed on the form. It is also possible to explicitly invoke the creation of custom settings using the built-in language using the CreateCustomSettingsFormItems() method of the dynamic list extension.
It is also possible to choose whether to place specific settings items in the user settings. This feature is available for selection and conditional design elements (see Figure 3).

If you want some items to be loaded when you open a dynamic list special settings, then this can be done in two ways:
● Using the dynamic list form parameter UserSettings. The data contained in this parameter will be placed in the user's dynamic list settings.
● Using the dynamic list form parameterUserSettingsKey. If you specify this parameter when opening a form, then the user settings located in the settings storage with the specified key will be loaded into the dynamic list, which is the main attribute of the form.

5. Search in a dynamic list

A dynamic list located on the form provides the ability to interactively search the displayed data. The search can be carried out using the following tools: search bar, search dialog, search for the current value, using the search history and setting the period (for dynamic lists displaying documents). The search result is a limited set of records
dynamic list (from available to this user) that match the search criteria.
To control the search capabilities of a dynamic list, there are three table properties on the managed form that displays the dynamic list:
● Search string position – determines the position of the search string. Can take the following values: Auto, Command Bar, None, Top, Bottom.


Rice. 4. Search string in a dynamic list

If the value of this property is set to Command Panel, then the search string will be displayed in the form command panel (if the dynamic list is the main form attribute) or in the command panel associated with the dynamic list. The search bar placed in the command bar is always pressed to the right edge of the command bar (along with the buttons located to the right of the search bar).
If the property is set to No, then the search string will not be on the form, and when you start typing search string a dialogue will open.
If the property is set to Top, the search bar will be located between the list command bar and the table displaying the dynamic list. If the property is set to Bottom, the search string will be placed immediately after the table displaying the dynamic list.


● If the Compatibility Mode property is set to Do not use or older than Version 8.3.4 – the value is Command Panel.
Go to the search line as follows:
● By pressing the key combination Ctrl+F;
● Mouse;
● When you start typing in a dynamic list (taking into account the value of the SearchOnTyping property of the dynamic list).
● View State Position – describes where the view state will be displayed: what fields were searched and what values
searched in every field. Can take the following values: Auto, None, Top, Bottom


Rice. 5. Search state in dynamic list

If the property is set to No, then the view state will not be present on the form. As a result, it will be possible to determine whether the search has been completed or not only by the availability of the Cancel Search button.
If the property is set to Top, the view state will be located between the list command bar and the table displaying the dynamic list. If the property is set to Bottom, the view state will be placed immediately after the table displaying the dynamic list.
If the form was created in 1C:Enterprise version 8.3.4 and earlier, the property is set to No. If the form was created in 1C:Enterprise version 8.3.5 and older, the property is set to Auto. The real value of the property in this case will be determined as follows:
● If the Compatibility Mode property is set to Version 8.3.4 (and lower) – value No;
● If the Compatibility Mode property is set to Do not use or older than Version 8.3.4 – value Top;
● Search Control Position – Determines where the search control button will appear. The button opens a menu that contains the following information: commands Find by current value, Advanced search, Cancel search, Set period (for document and journal lists) and search query history (last 5 queries). The property can take the following values: Auto, None, Command panel.


Rice. 6. Managing search in a dynamic list

If the property is set to No, then the search control button will not be on the form (but the commands will be available using the More menu). The Command Bar property value places a button on the command bar associated with a table displaying a dynamic list.
If the form was created in 1C:Enterprise version 8.3.4 and earlier, the property is set to No. If the form was created in 1C:Enterprise version 8.3.5 and older, the property is set to Auto. The real value of the property in this case will be determined as follows:
● If the Compatibility Mode property is set to Version 8.3.4 (and lower) – value No;
● If the Compatibility Mode property is set to Do not use or older than Version 8.3.4 – the value is Command Panel;
If there are several command panels on a form, the source of commands for which is one table of the managed form (displaying dynamic list data), then the search line and the search control button will be located in only one command panel:
● Or in the command bar of the dynamic list itself (if it has auto-completion enabled)
● Or in any of the remaining command panels.

Let's look at the features of using search in a dynamic list:
● To make the search convenient to use (including in terms of performance), you must enable full-text search for all configuration objects that can be used as the main table of the dynamic list. Also, the full-text search should include all details of configuration objects that may be displayed in a dynamic list and for which a search may be required.
If an object is excluded from full-text search, then the search mechanism in question will work, but the performance of such a search will be extremely low. It is not recommended to use search on objects that are not indexed by full-text search.
●B application solution There must be a routine task that regularly updates the full-text search index.

● The search is not performed on all columns of the dynamic list (and configuration object), but only on those columns that are displayed in the table.
● Search in a dynamic list by fields of reference types with arbitrary representation is performed by fields that are used for
representation formation (see here). The fields included in the view are obtained taking into account the ViewFieldGettingProcessing() handler of the corresponding object.
● For dynamic lists with a specified main table, full-text search is used on the main table. All non-indexed links from the main table will be added to the full-text search results. The result of a full-text search for the main table is used as a selection based on key fields. A full-text search is also performed on fields displayed in the list from other tables (if the field and configuration object are using full-text search). Without full text search enabled, data may be
found, but the search itself will be very slow.
If an error occurs while attempting to perform a full-text search, the search will be performed without applying the full-text search.
For example, this can happen when searching for one letter and a large number of lines in information base, starting with this letter.
● If a selection with the comparison type Equals is used for a field in the main table of a dynamic list, then when performing a full-text search, a selection value will be added to the search query for this table.
● The search string is split into words. This partition is performed according to the following rules:
● The line is broken using space and tab characters as delimiters.
● Then each resulting fragment is processed:
● If the fragment is a date representation (with or without time) based on the current session locale, then the word is the fragment.
● Otherwise, the fragment is split further using the characters “,.-/\” as delimiters. In this case, each resulting fragment of the string is taken as a word.

● For each word, its own set of conditions is formed, which are combined “by OR”. This set of conditions is generated if a full-text search for a given word in the table from which this field was obtained returned at least one object, or a full-text search was not used for this field. The conditions are formed as follows:
● For a field of type String, the condition is FieldName LIKE %Word%.
● For a field of type Number, the condition has the form FieldName=Value, where Value is a word converted to the Number type. If the cast cannot be performed, the field search will not be performed.
● The word is looked up as a substring in the default representation for the Boolean type defined for current session. If the search word is found in a view, it then searches for the value corresponding to the view in which the word was found. In this case, the search does not use views that are specified using the Format form element property.
● For a field of type Date, the condition looks like FieldName>=StartofDay(Word) ANDFieldName<=КонецДня(Слово). Если Слово подобно дате, в которой год
indicated by one or two digits, the year will be reduced to the current century and this value will be added to the search condition.
● For reference fields, a search is performed on the fields used to form the reference view. In each of these fields search
performed according to the rules described above. The search does not use fields used to form a custom data representation.
The set of conditions for each word are combined “AND”.
● For values ​​with leading zeros, you can search either the string with leading zeros or the string specified without leading zeros.
● If a dynamic list displays a list of documents or a document history, the list view interval that you specify is also displayed in the area of ​​the form reserved for displaying the view status for the desired dynamic list.
● The search by current value command is not available if the main table of the dynamic list is the selection criterion.
● Found string fragments are highlighted when displayed in the table.
● Only one search string is supported for one column. When adding a new search query for a column that is already being searched, the search expression will be replaced rather than the two search queries being added together.
● If the form does not have a form element addition of the form Search string display associated with the table (form element addition Source property) displaying a dynamic list, then pressing the Ctrl+F key combination opens the search dialog.


Rice. 7. Search dialog

If the form contains a form element addition of the form Search string display associated with a table (form element addition Source property) displaying a dynamic list, then to open the search dialog you should use the Advanced search command.
● When using the search dialog, keep the following points in mind:
● Opening the search dialog using a keyboard shortcut causes the value of the current cell to appear in the What to search line, and the value of the How to search switch is set to By exact match.

● Opening the search dialog by directly starting to type a search string in the dynamic list leads to the fact that the value of the How to search switch is set to the value By part of the string, and the typed text ends up in the What to search field.

6. Getting the data displayed by a dynamic list

When using dynamic lists, you may need to perform various actions on the data currently displayed by the dynamic list, taking into account the selections and searches applied. Such actions include: processing the displayed information, for example, resending selected documents or setting some details for selected objects, generating a list of available objects (with design, etc.), for example, for printing or saving to a spreadsheet document.
To obtain data that is displayed by a dynamic list, you should use the GetExecutableDataCompositionSchema() and
GetExecutableDataCompositionSettings().
Example of receiving data:

Schema = Elements.List.GetExecutableDataCompositionSchema();
Settings = Items.List.GetExecutableDataCompositionSettings();
LayoutLinker = newDataCompositionLayoutLinker();
LayoutLayout = LayoutComposer.Execute(Scheme, Settings);
CompositionProcessor = newDataCompositionProcessor;
LayoutProcessor.Initialize(LayoutLayout);
OutputProcessor = New OutputProcessorDataCompositionResultInTabularDocument;
ReturnOutputProcessor.Output(CompositionProcessor);

Getting data into a value collection (table or list of values) is done in the same way.
Obtaining dynamic list data in this manner has a number of features that must be taken into account when developing application solutions:
● The following table design is not supported:
● Alternating line colors;
● Header picture;
● Picture of the basement;
● Footer background color;
● Footer text color;
● Footer font;
● Horizontal position in the basement;
● Password mode.
● The conditional appearance specified for a managed form is not supported;
● When ordering a hierarchical table in ascending order by a field of type Link, records containing an empty link are always placed first.

Selection on managed forms in 1C 8.3

The article will discuss options for installing selection in managed forms 1C 8.3. The selection for a dynamic list can be set statically or dynamically, in the user interface or configurator. We will consider all selection options below.

  • Setting selection in the configurator

Setting selection in user mode

A dynamic list, as opposed to a table or tree of values, is a more suitable solution for implementing forms containing any lists, because The dynamic list provides the widest range of tools for working with selection, field grouping, and sorting. This selection can be set when working in user mode or the configurator, the principle is the same.

To set up selection in enterprise mode, you need to call the “Customize list” command.

A window will open.


The “selection” tab presents a list of fields that are in the current list. Select the list fields by which we will filter. This can be done by double clicking or using drag and drop.


We set the comparison type and value, click “Finish editing”, the selection is set.


When you set up selection in enterprise mode, so-called quick selection fields are automatically created on the list form.


In order for the 1C platform to automatically create quick selection fields, when developing a form in the configurator, you must specify a group of user settings.


This selection will be saved only for the current user, which allows flexible customization of the dynamic list. However, if the task is to make a fixed selection for a specific list for all users of the system, we can solve it only through the configurator.

Setting selection in the configurator

Working in the configurator, we can set two types of dynamic list selection – fixed and dynamic. Fixed selection can be configured once, dynamic or programmatic can be set depending on any data in the system.

The principle of setting a fixed selection in the configurator is no different from setting it in the user mode described above. To set the selection, we must open the dynamic list settings.


A window will open.


Selection is set in the same way as in user mode.

The “Include in user settings” option determines whether the selection set in the configurator will be available in user mode through the “Customize list” menu item.


Dynamic (software) selection

Often there is a need to set selection programmatically, for example, when opening a selection form, when we need to open a controlled form with selection. A parameter is passed to the form and selection is set based on this parameter. A common example of this is selecting directory items by owner.

Methods

If the configuration being developed contains the BSP “Basic Functionality” subsystem, software selection in the dynamic list can be installed using the standard method:

GeneralPurposeClientServer.SetDynamicListSelectionElement()

Signature of this method:

DynamicList Type: DynamicList – The list in which you want to set the selection.

FieldName Type: String – The field by which you want to set the selection.

RightValue Type: Arbitrary – Selection value (Optional. Default value: Undefined. Note: If you pass Undefined, the value will not be changed).

ViewComparison Type: DataComposition Comparison Type – Selection Condition.

Performance Type: String – Representation of a data composition element (Optional. Default value: Undefined. If specified, only the use flag with the specified representation is printed (no value is printed). An empty string must be passed to clear so that the value is printed again.)

Usage Type: Boolean – Flag to use this selection (Optional. Default: Undefined).

Display Mode Type: ItemDisplayModeDataCompositionSettings – How this selection is displayed to the user. Possible values:

  • Element Display ModeData Layout Settings.Quick Access – In the quick settings group above the list.
  • Element Display ModeData Layout Settings. Normal – In list settings (in the More submenu).
  • ElementDisplayModeDataCompositionSettings.Inaccessible – Prevent the user from changing this selection.

IdentifierUserSettings Type: String – Unique identifier for this selection (Used to communicate with user settings).

To remove a selection value, you must use the standard method:

General PurposeClientServer. RemoveGroupElementsSelectionDynamicList()

Signature of this method:

DynamicList Type: DynamicList – form attribute for which you want to set selection.

FieldName Type: String – name of the layout field (not used for groups).

Performance Type: String – Representation of a layout field.

If there is no BSP in the system, selection can be set independently using the DataComposition Field object.

Selection Element = List.Selection.Elements.Add(Type("DataComposition Selection Element")); Selection Element.LeftValue = NewDataCompositionField("Name"); Selection Element.Comparison Type = DataComposition Comparison Type.Equal; Selection Element.DisplayMode = ElementDisplayModeDataCompositionSettings.QuickAccess; // Optional Selection Element. RightValue = "Ivanov";

This selection will select rows in which the value “Full name” = “Ivanov”.

To use logical “AND”, “OR”, “NOT” the data type DataCompositionSelectionElementGroup is intended

Selection Group = List.Selection.Elements.Add(Type("Group of DataComposition Selection Elements")); SelectionGroup.GroupType = DataCompositionSelectionElementGroupType.GroupOR; Selection Element = Selection Group. Elements. Add(Type("Data Composition Selection Element")); Selection Element.LeftValue = NewDataCompositionField("Name"); Selection Element.Comparison Type = DataComposition Comparison Type.Equal; Selection Element.RightValue = "Ivanov"; Selection Element = Selection Group. Elements. Add(Type("Data Composition Selection Element")); Selection Element.LeftValue = NewDataCompositionField("Name"); Selection Element.Comparison Type = DataComposition Comparison Type.Equal; SelectionElement.RightValue = "Petrov";

This selection will select rows in which the value “Full name” = “Ivanov” or “Petrov”.

Selection in a dynamic list can also be done by changing the text of the dynamic list request. This option works when the dynamic list is made via a "custom request".


To do this, add the condition “WHERE IS THE TRUE” to the query text...


As you can see, this approach is more compact in terms of writing code. The more complex the selection conditions in the tabular part we want to set, the more cumbersome the option using selection through the Data Composition Selection Element will be. However, the example with changing the request text has its drawbacks - this implementation is not resistant to code changes. For example, you made such an implementation and forgot, but if in the future you want to modify the request text by adding some operator after WHERE (ORDER, GROUP), you need to remember that the program code contains:

List.QueryText = List.QueryText + " And DirectoryUsers.Full Name V(""Ivanov"",""Petrov"")";

If this is not taken into account, there will be an error, but to avoid this, you can change it to a different implementation. We add the following condition to the request text:

WHERE (NOT &SelectionInstalled OR DirectoryUsers.Name IN (&PermittedName))

List.Parameters.SetParameterValue("SelectionSet", Full Name.Quantity() > 0); List.Parameters.SetParameterValue("Allowed Full Name", Full Name);

Here full name is an array.

As you can see, 2 lines of code versus 10. Which method to choose depends on the specific application task.

Setting up 1C selection in a dynamic list is not as difficult as many users initially think. Such configurators are also used for tables of values. In 1C software, it is often necessary to sort data in graphs and cells according to some criteria.

How to set selection to a list?

You can create a selection in two ways: in the form of the list itself or register it programmatically. In the first case, you need to add a 1C 8 dynamic list to the form, define a main table for it, and then go to its properties. Controlled form allows you to work with the most different meanings. There you need to find the “List Settings” item and go to this menu. In the window that opens after the transition, you can manually set any sorter for the list you are using, and then manage the generated selection programmatically.

To install a dynamic sorter programmatically, you should know that selection in 1C is considered a property of a dynamic list. To add a selection using this quality, you need to add a new element to the selection property. For everything to work, you need to set the parameter in the right and left value selection fields, and also in the “Comparison type” field. It is important to enter the value "true" in the use field. This way you can create the simplest selection. By adding conditions in other fields, you can make it more complex and customize it to your needs.

Selections in the 1C value table

To set a selection in the table, you can use one of several options. You can do a manual selection - iterate through the table and hide all the rows that you don’t need. But this is a very labor-intensive process that not everyone wants to do. This the method will work only for those who are just starting to work with 1C and cannot yet master more complex but productive techniques.

The second table selection option operates through a table method called “find rows.” A significant disadvantage of this method is that the only type for comparison will be “equal”, which significantly reduces the possibility of using selection.

The most rational method of selecting a table can be done through the query builder.

Other features of a dynamic list in 1C

Dynamic lists provide ample opportunities for working with data, which were not available in 1C 7. One of the most convenient of them is creating selection forms. For example, in 1C: Accounting you need to go to the “Nomenclature” menu and add new uniform selection, designating it as the main one.

To set parameters in a dynamic list:

  • You can use selection forms;
  • When you create this form, a dynamic selection list will automatically appear in the field;
  • By going to its properties, you can see the “Custom request” item. It is this query that allows you to take advantage of all the advantages of a dynamic list;
  • You can enter your parameters into this request;
  • By checking the box and opening this window, you can see a new request, with all the fields from the item reference book;
  • By clicking on the query builder button, you can change the contents of this list.

To add your own request to the drop-down list, you need to go to the settings tab. In the first tab you will see the opportunity to make any selection according to your needs.

Programmatic installation of the request

You can set the request and programmatically. To do this, you only need to enter a few lines into the form module. After this, you just need to double-click on the current row to transfer the rows with the selected values ​​to the document.

In 1C, a list of values ​​on a form is a great way to work with software 1C is more rational and productive. This allows you to optimize all work in the enterprise.