The main props of form. Details of the controlled form (1CV8) Details forms 1C 8 2

Below are the main objects 1C, which are used when working with manageable forms. A brief examples of the code that demonstrate the traditional use of these objects when writing 1C configurations is given.

Etform

Used in the form module, in procedures& Change and & Nasserver.

Allows you to apply to the elements of the form and to details.

Appeal to the form element occurs through the objectElements and looks like this:

Etform. The elements. Maintenance. Putton \u003d "v." + Version program;

Appeal to the propulsion existing on the form, is true:

Etform.The setpoints \u003d "Hello, comrades!";

Simplified appeal to elements of form and details

In the module form, in principle, you can not specify the keywordEtform . You can contact the form elements and the details are simplified:

// Form element

Elements. Overweight. The head chair \u003d "v." + Version program;

// Requisite forms

Text \u003d "Hello, comrades!";

Features of obtaining details of forms (important!)

If the requisition of the form has a simple type -Row, number, date ... then get (set) the value of the props is simply named:

Text \u003d items; // Product Name - this props form

However, in this way it is impossible to obtain the details of the "complex" type -Tables, Woodnames . When trying to obtain props with such a type of name, the object type will be returnedDocumentation COLLECTION.

To get the value of props with a "complex" type, you need to use the functionRequisitformAdrification ():

Current Palace \u003d RequisitformAdded ("selected objects");

To set the value of the "complex" props, you can use the functionSurrenceVisitforms (<Значение>, <ИмяРеквизита>) Both parameters are required.

Functions RequisitformAdrification () and ValuerereVisitforms () Available only on the server.

An object

Strictly speaking, there is no such keyword within the form of a form. Just when a form is created, for example, a form of an element, 1C automatically creates props on the form with the nameAn object . Through this props are available properties of the current object, which is edited on the form.

or, more complete entry:

This object

Contains the object itself. Designed to obtain an object in the object module or module form.

Use: read only.

Availability: Server, Thick client, external connection.

Forms In 1C: The company is intended to display and edit information contained in the database. Forms may belong to specific configuration objects or exist separately from them and used by all applied decision as a whole.

For example, reference book Nomenclature It can have several forms that will be used for certain purposes - editing the directory element, display display, etc.:

Along with this, there may be common forms that do not belong to specific configuration objects - common forms.

Basic forms

Each configuration object can be used to perform some standard actions. For example, for any reference book, you may need to display a list of its items, display separate elements of the reference book, display a group of the directory, select elements and groups of elements from the directory. For any document, a list of such actions will be much less: viewing a list of documents, a choice from the list of documents and view a separate document.

To ensure that such standard actions are executed with data objects, for each of them there is a set of basic forms that will be used when performing appropriate actions. Main can be assigned any of the forms subordinate to this object. For example, at the directory Nomenclaturethe following main forms may exist:

And the document Admission of goods and servicesthe composition of the main forms will be different:

Thus, if the user wants to see a list of reference book Nomenclature or document list Admission of goods and servicesThe system will open the appropriate form assigned as a list form for these objects.

Auto-generated forms

An important feature of the 1C system: Enterprise 8 is the mechanism of auto-generated forms. This mechanism frees the developer from the need to create all possible forms for each of the configuration objects. The developer is enough to add a new configuration object, and the system itself will generate the necessary forms to display the information contained in this object to the desired moments of the user's operation.

Thus, the developer needs to create its own forms of application objects only if they should have differences (another design or specific behavior) from forms automatically generated by the system.

Communication form with data

An affiliation of the form for one or another configuration object does not determine the data composition that is displayed in the form. The fact that the form belongs, for example, a directory NomenclatureAllows you to assign it to one of the main forms for this reference book, but does not determine what the data will display this form, and what will be its behavior.

In order to associate the form of data, the details of the form are used in which the list of data displayed by the form is specified. All forms, by themselves, have the same behavior, no matter what data they display. However, one of the details of the form can be appointed for it the main (it is highlighted in bold), and in this case the standard behavior of the form and its properties will be supplemented depending on which type has the primary props of the form:

For example, if a document will be assigned as the main details of the form Admission of goods and services, When you close the form, the system will request confirmation of the recording and conducting this document. If the main details of the form assign, say, reference book Nomenclature, then such a request for confirmation when closing the form will not occur.

Form structure

The main feature of the forms is that they are not drawn by the developer in detail, "on pixels". The configuration form is a logical form of form composition. And the specific placement of the elements is performed by the system automatically when the form is displayed.

The displayed part of the form (visible to the user) is described as a tree comprising form elements.

Elements can be input fields, checkboxes, switches, buttons, etc. In addition, the element may be a group that includes other elements. The group can be presented as a panel with a frame, a panel with pages (bookmarks), actual page, command panel. In addition, the element may be a table that also includes elements (columns). The structure of the elements describes how the form will look like.

All formality of the form is described in the form of details and commands. Details are the data with which the form works, and the commands are performed. Thus, the developer in the form editor must include the necessary details and commands in the form, create their form elements and, if necessary, to compose elements in groups.

Based on this logic description, the system automatically generates an appearance of the form to display the user. In this case, the system takes into account the various properties of the displayed data (for example, type) to make the elements of the form as convenient as possible for the user.

The developer can affect the location of the elements by various installations. It can determine the order of elements, specify the desired width and height. However, this is only some additional information that helps the system is displayed.

In forms, the developer can use not only the commands of the form itself, but also the global commands used in the entire configuration command interface. In addition, it is possible to create parameterized commands that will open other forms, taking into account specific data of the current form. For example, it may be a call to the residue report on the stock that is selected now in the form of consumable invoice.

Requisites of form

The set of details of the form describes the composition of the data that is displayed is edited or stored in the form. At the same time, the details of the form themselves do not provide the ability to display and edit data. Elements of the form (see the "Form" elements section of this chapter) associated with the details of the form are used to display and edit. The combination of all form details will be called for form.

Important! It must be remembered that, unlike conventional forms, all data of the managed form must be described in the form of details. It is not allowed to use variables of the module of the form as data sources for form elements.

There is an opportunity to designate The main props of form, i.e. props requisite, which will determine the standard formality of the form (extension of the form). It should be remembered that the main props of the form can only be one.

Expansion of form - These are additional properties, methods and parameters of the object form of the controlphone characteristic of the object, which is the main element of the form.

In the process of developing a form, it is possible to clearly set the possibility of viewing and editing specific details of the form, in the context of the roles, using the Preview and Editing properties (here, see the "Role-Tuning Form" section of the head "editors"). In addition, the availability of a particular details in the most form can be configured using functional options (more on functional options can be viewed in the chapter "Management of the Configuration Interface").

Property property form Saved data It is a sign that the interactive change in the props will lead to an attempt to block these form for editing, as well as to the automatic setting of the form of the modified form.

Data Types available in managed form

The managed form differs from the usual form also and the types of data with which it works. If the usual form works with most types, which provides 1C: Enterprise (including the type of reference bookgent, document object, etc.), then the following categories of types can be distinguished in the managed form:

  • types that are directly used in the form are those types that exist on the side of the fine and web client (for example, the number, the Directory. Reloars, Graphicsham, Timber);
  • types that will be converted to special data types - data types of controlled form. Such types are displayed in the list of details of the form in parentheses, for example (reference booking. Turns);
  • dynamic list (For more information, see the "Dynamic List" section of this chapter).

Convert application objects to form data

Some applied types (such as the directory reference, etc.) do not exist on the side of thin and web clients (for details, see the chapter "The Concept of the Managed Application"). Therefore, for the presentation in the form of such applications in the platform, special types of data are entered, designed to work in managed forms. This feature of the managed application causes the need to perform the conversion of application objects to the form data (and back).

The following data types are used:

  • Properturance - Contains a set of arbitrary type properties. Properties can be other structures, collections or structures with collections. Such a type seems to be, for example, in the form of a directory.
  • Documentation COLLECTION is a list of typed values \u200b\u200bsimilar to an array. Access to the collection element is carried out by index or by identifier. Access by identifier may be absent in some cases. This is due to the type of applied object, which is represented by this collection. The identifier can be any integer. This type seems to be, for example, in the form of a tabular part.
  • The structure test is an object that is represented as a structure and collection at the same time. You can contact him as with any of these entities. This type seems to be, for example, in the form set of records.
  • PATFORMANDEVO - OBJECT Designed for storage of hierarchical data.

The application object is represented by either one or several elements of the form data. In general, the hierarchy and composition of these forms depend on the complexity and relationship between the application objects of the controlled form.

For example, a document containing the tabular part will be represented by an object of the type of structure (actually a document), which is subject to an object of the type of informational formation (tabular part of the document).

Important! During configuration development, it is important to remember that application objects are only available on the server, while the form data objects can be used on the server and on the client.

Data transfer between client and server parts of the managed form

In fact, it can be said that the form data is a unified presentation of these various application objects with which the form works uniformly and which are also present on the server and on the client. That is, the form contains some "projection" of data of application objects as its own data types and performs the transformation between them if necessary. However, if the configuration developer implements its data processing algorithm, the data transformation (from specialized types in applied and back) it must be performed independently.

When editing the details of the form in a specialized editor (for details, see the "Details" section of the chapter "Editors") It is possible to influence the transfer of data between the client and the server during the form work. This serves as a column of the requisite editor. Use always. The action of this property varies for three types of details:

  • For props, subordinate to the dynamic list (dynamic list column):
    • the property is enabled - props is always read from the database and is included in these forms;
    • the properties are turned off - the props is read from the database and is included in these forms only when there is a visible element of the form, associated with the props or its subordinate requisite.
  • For props, subordinate collection of movements:
    • the property is enabled - the document movement is read from the database and will be present in the form data;
    • the property is turned off - the document movement will not be read from the database and will not fall into the form data (if there is no shape element referring to the movement of the document).
  • The remaining details of the form:
    • the property is enabled - the props will be present in these forms, regardless of whether or not at least one element of the shape, which is associated with the requisite or its subordinate requisites;
    • the properties are turned off - the props will be present in these form only if there is an element of a form associated with the props or its subordinate requisite. Unlike the details of the dynamic list, it does not play the role of the visibility of an element associated with the props.

Note. It should be remembered that the property installed in the parent details is valid for all subordinate details. For example, if the use property is always removed from the table part of the document, the system believes that this property is removed from all subordinate details (despite the actual state of the property).

Methods for converting data for applied objects to these form

To convert applied objects to the form data and back there is a set of global methods:

  • Meaningrendanephors (),
  • ClaimsVassion (),
  • CopyDanforms ().

Important! Methods working with application objects are available only in server procedures. The method for copying values \u200b\u200bbetween the form data is available on the server and on the client, since it does not require application objects as parameters.

During the conversion of the form data in the applied object, their compatibility should be taken into account.

  • Meaningrendatinforms () - converts an application type object to form data;
  • Claiming () - converts form data to an applied type object;
  • CopyDanforms () - Copying these shapes with a compatible structure. Returns the value of truth if copying is manufactured, or false if the structure of objects is incompatible.

Note. When performing standard actions (opening the form, execute the standard command to record, etc.) forms with the main details, the transformation is performed automatically.

Let us give an example, how to use data transformation in your own algorithms.

& NASTERER PROCEDURE PROCEDURE (Failure, Standard Processing)

Objects \u003d References. Tasters. Intertionation ("Coffee Plant"). Receive (); Meaningrendaniforms (object object, object);

Extrudresses

& Custom Procedure Record ()

Record server ();

Extrudresses

& Nasserver Procedure Write aserver ()

Objectovar \u003d Propeformations (object, type ("reference booking. Turns")); Object project ();

Extrudresses

Also, the object manager has a methods available on the server:

  • Sign-sequentiallyrevisitforms () - performs the conversion of an applied type object to a specified form props.
  • RequisitformAvdiction () - converts the requisites of form data into an application type object.

The use of these methods is usually more convenient, as they have, for example, information on the type of form props. In addition, the Requisite Relationship () method () performs the setting of the correspondence of the form data and the object, which is used when forming messages. You can read more about this in the chapter "Service Features of Navigation".

We give an example of using these methods.

& Nasserver Procedure Recalculate Server ()

// Converts the props object in the application object. Document \u003d RequisitraftForms ("Object"); // Performs recalculation by the method defined in the document module. Document. Perform (); // Converts an applied object back to props. Recentlyrerevisitforms (document, "object");

Extrudresses

Program interface

PATFORMANDEVO (FORMDATATREE)

  • FindByid FindByid
  • Options (GetItems)

Description:

Designed to model the tree in the data controlled form.

This object can be serialized to / from XDTO. The XDTO type corresponding to this object is defined in the namespace. XDTO type name:

Options (GetItems)

Syntax:

Optional ()

Return value:

Type: Power Collections Electrhenidev.

Description:

Gets a collection of elements of the top-level tree.

Availability: Client, Server, Slim Client, Web Client.

FindByid FindByid

Syntax:

FindingFider (<Идентификатор>)

Parameters:

<Идентификатор> (mandatory)

Type: number. Tree element identifier.

Return value:

Type: Paramerterev.

Description:

Gets an element of the collection by identifier.

Availability: Client, Server, Slim Client, Web Client.

EatelTatreeItem (FormDatTreeItem)

Properties:

<Имя свойства> (<Имя свойства>)

  • GetId GetId
  • GETPARENT)
  • Options (GetItems)
  • Property (Property)

Description:

Element of tree data form.

EatelTatreeItemCollection (FormDataTreeItemCollection)

Elements of the Collection: Eatellanerev

For the facility is available bypass collection by operator for each ... from ... cycle. When traversery, elements of the collection are selected. It is possible to appeal to the collection element by operator [...]. The index of the element is transmitted as an argument.

  • INSERT)
  • Add (Add)
  • Index (indexof)
  • Quantity (Count)
  • Clear (Clear)
  • Get (Get)
  • Shift
  • Delete

Description:

Collection of wood elements.

Availability: Client, Server, Slim Client, Web Client.

See also:

  • Primary Elementider, Optional Method
  • PATFORMANDEVO, OPERATION METHOD

Features of working with tree values

Tree update

There is a problem fall Platforms when updating the tree.

If some node has been deployed in the tree and the slave node is selected, then when updating the tree function Validewandenforms Platform drops.

Solution: Before the update you need to clean the tree.

For example:

& Nasserver Procedure Cleaner (Elements) for each element from the Cleathelder cycle elements (element. Pouring elements ()); EndCycle; Elements. Operate (); Extrudresses

& The ground procedure of completion () measurement \u003d qtzdyatiyia \u003d grades.Postroytreyonia (Nadat, meta.Tenect ()); Clearness (woodcuts. Focus elements ()); Meaningrendaniforms (ripponium, woodcuts); Extrudresses

& Complaint procedure for notification of (element) of fillets (); Extrudresses

Form details ensure its connection with the data. At the same time, one (and only one) from details can be appointed main; It may not necessarily be that type of data, to which we draw the form. But on the type of main props data will depend on the behavior of the form. In addition to changing the behavior of the form, the context of the form module occurs. Along with the methods and properties of the form, it becomes available methods and properties of an object that is the value of the main details. It is important that the forms of the "arbitrary form" do not have the main props. In this case, the behavior of the form is determined only by user settings. Consider issues on the main details.

Question 10.05 Exam 1C: Professional on the platform. What is the main props of form?

  1. Determines the data source for the form in general
  2. Defines the standard features of the platform for the operation of the type of data specified at the main props
  3. To ensure the possibility of software access to the details of the object from the local context of the form
  4. Provides visualization of object details on the form dialog
  5. Verpel 2 and 3
  6. Correct 1 and 2

The correct answer is the sixth, see above.


Question 10.06 Exam 1C: Professional on the platform. What are the details of the form?
  1. To describe the composition of the data that are displayed, edited or stored in the form
  2. To display and edit data in the form
  3. Correct 1 and 2

The correct answer is the third - both.

Question 10.07 exam 1C: Professional on the platform. What would arbitrary managed form assign the main props ...

  1. it is necessary in the properties of the details of the form to select the "Main props" checkbox
  2. you need to fill in the "data" property, selecting the desired form props

The correct answer is the second:

Question 10.08 exam 1C: Professional on the platform. Whatever an arbitrary usual form to assign the main props ...
  1. the form you need to make the main one, the main props at the same time is determined automatically.
  2. it is necessary in the properties of the details of the form to select the "Main props" checkbox
  3. you need to enter the "Edit" menu, item "Main props" and select the desired value
  4. you need to fill in the "data" property, selecting the desired form props

Correct answer Fourth:

The main props is highlighted in bold:

Question 10.09 Exam 1C: Professional on the platform. In the presence of one basic details of the form, can one add another basic props?
  1. It's impossible
  2. It is possible by assigning the corresponding value of the property requisite property.
  3. You can only programmatically when referring to the form "Form"
  4. It is possible by adding another value to the corresponding form property.

The correct answer is the first, the main props is strictly alone, because Communication with the object should be unambiguous.

Question 10.113 Exam 1C: Professional on the platform. Which of the details of the form shown in the figure is the main one?

  1. List karsovivutu
  2. Directory object
  3. For the forms of reference books there are no main details
  4. At the forms of reference books all details are the main
The correct answer is the second one that fat.

The user with reference books and documents in 1C consists of filling the fields on the form.

Details 1C are the directory and document fields that are displayed on the form so that the user filled them.

Consider in detail the topic of details in 1C.

What is 1C details

Each reference book and document 1C consists of a set of fields. Such fields are called 1C details (for the 1C programmer).

In the configurator, in the 1C configuration tree, expand any directory or document and you will see a branch of the details. This is a list of details (fields) of the directory.

View as the same details 1c look on the form of the 1C reference book.

Each property of 1C has properties that indicate what kind of value is stored in the prop. (String, number, etc.) and how the user will work with it.

Right-click on any props 1C and click Properties. The list of properties of the selected props opens in the right window.

The main properties of 1C details:

Standard details 1C.

As you notice, there are 1C details on the form of the directory, which are not listed in the configurator: group, name, bik.

In the form of a list of reference book, also there are details of 1C, which are not listed: a removal mark.

These are standard details 1C. What it is? Everyone has a set of details 1C by default. For reference books, for example - code and name. Documents this is the date and number.

Standard details 1C can be viewed as follows:

  • Go to the 1C object editor (directory or document) by clicking on it twice with the mouse
  • In the window that opens, select the data tab
  • Here you can configure standard details Code and reference name
  • Click the Standard Details 1C button to view the full list.

General details 1C.

Starting from version 1C 8.2.14 in 1C, a new object 1C appeared - General details 1C. Using it, you can add props (field), which will be present immediately in a variety of reference books and documents.

Properties of total details 1C:

  • Auto use - adds total 1C props to all reference books and documents
  • The composition - allows you to add a total details of 1C only to the necessary reference books and documents (auto use then not to use to value).

How to add requisite 1c

Right-click on the branch of 1s the desired directory and select Add.

We introduce the name of 1c props, for example, "addiction" and synonym for an office ". Type Let's leave the default line, but put a tick unlimited length.

We will add another props 1C in the same way, just choose the type of Boolean, let's call it "running".

How to derive props on the form 1C (thick client 1c)

We will reveal the branch of the form of the same reference book. To open the form - choose the form of the item and press it twice with the mouse.

Pull the mouse over the edge of the form and stretch it (optional item).

In the configurator panel, click the "Data Placement" button. You can also use the menu / placement menu.

You see - our form details are not bred. Install the checkbox on them. And also ticks insert the inscriptions and place automatically.

How to derive props on the form 1C (subtle client 1C)

We will reveal the branch of the form of the same reference book. Select the form of the element and press it twice with the mouse.

On the Requisites tab, open the Line object. You will see a list of details added earlier in the directory.

Now simply drag from the right window to the left right props and it will appear on the form.

Requisites forms 1C.

In the Tolstaya Client, the form has its own props. They are on the details tab.

These details are not stored in the database, but they can be used on the form for fields that are needed to work with the form.

For example, you added a tick. When it is pressed on the form, something happens. The check mark value for you does not matter (it is not necessary to write it) - it is used only to switch the form when working with it. In this case, as data, you do not use the requisite of the directory, but the form props.

Periodic details 1C.

In 1C version 7.7 were periodic details. Their meaning is: the value of the props is different in different dates. For example, the value on September 1 is one, and on October 1 - another. At the same requisite.

In 1C 8 periodic details no. This is implemented as follows: