Menu
Is free
registration
home  /  Advice/ Checkbox in the form of a list of 1c document. The form

Checkbox in the form of a list of 1c document. The form

Control elements represent a separate group of objects intended for entering and presenting information in dialogs. They can be located on the form, used to edit the cells of a table field, a table document.

The button is one of the most frequently used control elements in the forms of applied solutions of the 1C: Enterprise program. In this video tutorial, together with you, we will create the simplest 1C application object - the so-called "processing", then we will create the main processing form and learn how to add such an important control element to this form, called "Button"

1. Creation of test processing

Hello dear friends! Degtyarev Roman with you. Training - Center "Start in 1C".

Read the text and at the same time watch a short video cheat sheet, in which we will talk about inserting interface elements into the form of any 1C application object (including 1C processing, by which we will consider this process)

A video showing the entire process is below.

You can watch this video in high quality and in full screen mode using the video playback control buttons

This will be useful to us in general, both as a basic skill in constructing forms, and for performing other practical exercises.

We will talk about inserting one of the types of interface elements used in any 1C: Enterprise application solution, about inserting buttons into a form.

Let's start our training course with you. applied solution in the configuration (development) mode This instruction, about an educational application solution, applies to those who are trained in our 1C programming courses.

Those who do not take courses can run any available application solution in the configuration mode, including a completely empty one. This will be enough study for the example in question.

In order for us to have where to insert buttons, let's first create some kind of separate processing in the tree of configuration objects.

So, we entered the application solution configuration mode. Let's create the processing with you. Right click on the node "Processing" and the menu drops out.

Select the item with the name in the drop-down menu "add"... The visual processing designer window will open.

We can call the processing by some specific name, or we can not call it - and leave the name that is assigned by default.

For example, let's give our processing a name "Test processing"... You name it yourself as you require, if you create processing.

After assigning a name to our processing, we can immediately click the button at the bottom of the constructor window "Close"- since no other action is required.

Test processing has been created, we can see its name in the configuration tree, in the node "Processing"... Let's click on the name of our processing, expand this item and see the sub-elements that can be part of our processing: “Requisites”, “Forms”, “Layouts” and so on.

2. Creation of the main processing form

Now it's time to create a form for our processing. The processing form is a visual representation, the main dialog box that the user will see and with which he will interact if he starts our processing for execution.

It is analogous to a window, a form of any other program under Windows - and can include menu items, command panels, input fields, labels, buttons, drop-down lists and other controls - all those elements that we are used to when working with most regular programs.

Let's right click on the node "Forms", then, in the appeared context menu, select the item with the name "Add"

A window of the processing form constructor appears in front of us. With its help, at the initial stage, we can indicate some of the features again the created form(its programmatic name, type, is it primary, and so on)

But now we don't need to make any special settings, so we just click the button "Ready", at the bottom of the processing form designer window.

After that, a newly created 1C processing form opens in front of us.

3. Now let's look at the process of creating buttons in the processing form.

So how does button insertion work?

Note that by default, in the newly created form, some buttons are already inserted during processing design. These buttons are inserted automatically.
These are standard “action” buttons of two so-called command panels located in the upper part of the form window and in the lower part of the window.

We are now interested in those buttons that we will insert ourselves, “manually”.

In order to insert some kind of interface element, including buttons, into the constructed form, we must press a special button with an “icon” (a yellow “plus” sign is visible on the icon), which opens a window for selecting an interface element for insertion.

This special button with an “icon” is usually located on the toolbar, under the main menu of the main configurator window.
When you hover the mouse over the desired button, a tooltip appears "Insert Control" .

If there is no button on the toolbar (it depends on the settings of the toolbars), we have an alternative way: When we have a form designer window on the screen, we can select the item from the main menu of the configurator: "Form" / "Insert Control".

Regardless of whether we clicked a button in the toolbar, or selected an action from the main menu, a special window for selecting a control for insertion opens in front of us. The window has a title

We see many different controls in the window. (You can practice at your leisure and try to insert these elements into the form, see how they look).

Now we are interested in the element "Button"... By default, after opening a window "Inserting a control", the first element from the list of possible elements is just selected for insertion, and this control is - "Button".

The choice of the type of control for insertion is carried out in the left part of the window, and in the right part of the window it is possible to set some properties of the element before it is inserted into the form.

That is, before inserting a control into a form, it can be “prepared” in advance by setting its main properties: name, title, tooltip text on mouse over, and some other properties.

For example, we can assign a name to any element, including a “button”, before inserting it. This name will be the name of the object in the built-in 1C: Enterprise language, the name of the program object.

This is the name that can then be accessed from the embedded programming language.

Similarly, we can assign a title to the button, an inscription on it. In our example, we'll give the button a title "Our button" .

If we want that when this button is pressed, some action is performed in the built-in programming language, then we should not uncheck the “create procedure” checkbox. By default, this checkbox is enabled.

If this checkbox is enabled, then simultaneously with the insertion of the button, an empty handler procedure will be created in the program module of the form, in which we can write any necessary algorithm that is executed when this button is pressed in user mode.

There, in the window "Inserting a control" we can enter the hint text if we wish. Let's in the input field "Prompt" write - "This is our button" ... This tooltip will appear when you hover the mouse cursor over the inserted button.

That's it, the preparation before insertion is complete, now we press the button "OK".

After that the window "Inserting a control" closes and now we can insert our button anywhere in our form. The mouse cursor icon has been temporarily changed to a large "plus" - this way the system prompts you to point with the mouse to a specific place on the form where we are going to insert the control.

Choose a place for the button in any part of our form and click left button mice. Our new button was inserted into the form, and at the same time the form constructor instantly switches us to the form program module editor window.

It shows us the body of the click event of the newly inserted button. That is, we can immediately write the code that will be called when the button is pressed.

Let's get back to the bookmark after all "Dialogue"(the form designer tabs are located at the bottom of the window) and make sure that the button appears in the form. Yes, our button is here!

We can change its size by "dragging" the corner of the button, or move our button somewhere within the form window.

And by going back to the program module (tab "Module") - we can write code in a programming language to perform actions by pressing our button.

Let's enter some code, let it, for simplicity, consist of only one line “ Report (“Our button has been pressed!”);

This code will cause the following text to appear in the service message window when the button is pressed on the user's screen: “Our button has been pressed”.

Let's check, run our application solution in user mode.

Next, select the item in the main menu "Operations" / "Processing"... Remember that we created a treatment and named it "Test processing", therefore, we select processing with this name from the list that opens.

Tmk, we see the form of our processing in front of us. In the form, we see our button with the title "Our button" ... Please note the hint "This is our button" appears when you hover the mouse cursor over the button.

Now let's press the button. We make sure that the message that we have programmed is displayed in the service message window: "Our button has been pressed" .

Likewise, we can insert any other controls that we talk about in our courses and video cheat sheets.

Summary: We have successfully inserted a button on the processing form, and now you should be able to do it. See you in video tutorials.

Degtyarev Roman was with you.

Training center "Start in 1C"

How to learn to program in 1C from scratch?

How to work as a 1C programmer and get up to 150,000 rubles a month?

SIGN UP FOR FREE

2-WEEK COURSE

"PROGRAMMING in 1C FOR BEGINNERS"

The course will come to email... Become a programmer by completing step by step tasks.

To participate you only need a computer and the Internet

Free access to the course:

Sp-force-hide (display: none;). Sp-form (display: block; background: # eff2f4; padding: 5px; width: 270px; max-width: 100%; border-radius: 0px; -moz-border -radius: 0px; -webkit-border-radius: 0px; font-family: Arial, "Helvetica Neue", sans-serif; background-repeat: no-repeat; background-position: center; background-size: auto;) .sp-form input (display: inline-block; opacity: 1; visibility: visible;). sp-form .sp-form-fields-wrapper (margin: 0 auto; width: 260px;). sp-form .sp -form-control (background: #ffffff; border-color: #cccccc; border-style: solid; border-width: 1px; font-size: 15px; padding-left: 8.75px; padding-right: 8.75px; border -radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; height: 35px; width: 100%;). sp-form .sp-field label (color: # 444444; font- size: 13px; font-style: normal; font-weight: bold;). sp-form .sp-button (border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; background-color: # f4394c; color: #ffffff; width: 100%; font-weig ht: 700; font-style: normal; font-family: Arial, "Helvetica Neue", sans-serif; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; background: linear-gradient (to top, # e30d22, # f77380);). sp-form .sp-button-container (text-align: center; width: auto;)

The article describes the use of the “TO CHANGE” construction of the 1C query language. This material will be especially useful for those who want to understand the peculiarities of register locking when working with information base in the client-server version.

Applicability

The material of the article is relevant for configurations using the current versions of the 1C: Enterprise platform, version 8.3, while using the automatic mode of blocking data management.

DESIGN TO CHANGE

Using automatic mode Read locks without the TO CHANGE option and then write locks within the same transaction can lead to deadlocks caused by insufficient resource locking.

The CHANGE construct is used to set an update U lock, which is less compatible with other locks, instead of a shared S lock:

The table contains a "+" sign if the locks at the intersection of a row and a column are compatible, "-" otherwise.

Let's briefly consider the main types of locks.

Shared (S) locks allow concurrent transactions to read a resource. As long as there are S locks on the resource, other transactions cannot modify the data.

Update locks (U) prevent a common form of deadlock from occurring. In a serializable or iterative read transaction, the transaction reads data, requests a shared (S) lock on a resource, then performs a data change that requires converting the lock to an exclusive (X) lock.

If two transactions request a shared lock on a resource and then try to update the data at the same time, then one of the transactions tries to convert the lock to an exclusive (X) lock.

Converting a shared lock to an exclusive lock will take some time because an exclusive lock for one transaction is incompatible with a shared lock for another transaction.

Waiting for blocking starts.

The second transaction will try to acquire an exclusive (X) update lock. Since both transactions are converting to exclusive (X) locks and each transaction is waiting for the other to release the shared lock, the result is a deadlock.

To avoid this potential deadlock, update (U) locks are applied. Only one transaction at a time can set an update lock (U) for a resource. If a transaction modifies a resource, then an update (U) lock is converted to an exclusive (X) lock.

Exclusive (X) locking prevents transactions from concurrently accessing the resource. If the resource is held with an exclusive (X) lock, then no other transactions can modify the data.

The construct TO CHANGE is specified in the query constructor on the tab Additionally:

The same tab indicates which specific tables should be locked if multiple tables are used in a query. If you do not specify which tables to lock, then U-locks will be applied to all tables specified in the query, including those that will not be written in the future. These locks will be redundant and can create problems when multiple users work in parallel.

This problem does not exist in controlled locking mode, so the FORMAT construct does not affect anything.

1. Ways to create a form
2. Form constructor

Form creation methods

Having learned about the 1c forms, let's move on to a deeper acquaintance. First, let's create a form, it can be the form of any object, in this example it is a reference. There are several ways to create a form:

1. From the constructor of the object 2 ways

2. From the configuration tree through the context menu (right-click on the object highlighted in blue in the figure).

Form constructor

While creating new form the form constructor window appears:

The type of form that the designer offers to choose will affect the initial filling of the elements. The main options for types are:

    Item form (document, set of values)

    List form

    Selection form

The checkbox " Assign the main form"Means that if there are several forms of this type and when calling a form of this type a specific one will not be specified, the main one will be displayed. For example: there is a list form "ListFormShort", which is the main one and "ListFormFull", if you call the list form and do not specify a specific one, then "ListShort form" will be displayed.
The main forms are visible on the "Forms" tab of the constructor of the variable object.

The checkbox " Basic form of list and selection"Means that this form will be displayed both for viewing the list and for selecting.

The checkbox " Basic form of element and group”Means that this form will be displayed both for editing an element and for a group.

Next comes the props “ Name»It is the identifier of this form, you cannot create two forms from one object with the same identifier.
Props " Synonym"Will be displayed in user mode as the name of this form.
Props " A comment»Stores any notes or explanations.

Checkboxes " Command bar on top" and " Command panel below"Indicate where to display command panels. The command bar is a form element that contains buttons. For example:

For myself, I mainly use the following method for creating a form, if the object is new, then I call the constructor from the object on the "Forms" tab, the "Basic Forms" group, by clicking on the "Open" icon (magnifying glass) (Figure 1). If the object has basic forms, then I call the constructor from the metadata tree using the "Add" method from context menu branches "Forms" (Figure 2).
I will make a small explanation about the relationship between the form and the object. Generally correct installation properties reduces the need to write code.
The form has the "Data" property, it is the main one for the form and is highlighted in bold on the "Details" tab.

That gives the affixing of the "Data" property, depending on the selected value, new events, form methods and the ability to add the corresponding command bar buttons are added.
Example: " ParameterCurrentString"- this property is available in the form module if the type of the main attribute is DirectoryList.

On a bookmark Additionally additional options for building a query are grouped:

Let's consider their purpose.

  1. First (n) - allows you to select a specified number of records, the first in the request, taking into account the specified order of records. In the request text, it will generate keyword SELECT FIRST N
  2. No duplicate - will leave only unique records in the detailed records of the selection. In the request text will generate the keyword SELECT VARIOUS
  3. Allowed - required to configure access rights restrictions; only the records allowed for the given authority will be shown (if the option is not set, the modet request will not be executed with limited rights, return an error). In the request text, the option will generate the keyword SELECT ALLOWED
  4. Query type - fetching data or creating a temporary table. The temporary table option allows you to specify its name; this table can subsequently be accessed as an intermediate data source for the edited query. In this case, the keyword will appear in the query text PLACE
  5. Block the received data for subsequent modification - it is assumed that while reading from the source tables is in progress, they are blocked for reading in other sessions. If the option is enabled, the keyword will appear in the query text FOR CHANGE. In this case, you can specify which tables from among those involved in the query are locked; if this is not done, then everything will be blocked.

Question 07.21 of exam 1C: Platform Professional. The No Duplicate Records flag on the Advanced tab of the query designer allows you to:

  1. Exclude duplicate rows from data source tables
  2. Exclude duplicate rows from the resulting query table. This operation applies to both detailed and summary records
  3. Exclude duplicate rows from the resulting query table. This operation applies only to detailed records.

The third answer is correct. The uniqueness requirement does not apply to the totals.

Question 07.22 of exam 1C: Professional on the platform. The "Top 5 Records" flag on the "Advanced" tab of the query designer allows you to:

  1. Display the first 5 records in the report. Records will be selected without regard to the ordering rules configured in the query builder
  2. Display the first 5 records in the report. Records will be selected based on the ordering rules configured in the query builder

The correct answer is the second, the order will be taken into account.

Question 07.23 of exam 1C: Professional on the platform. The "To change" flag (in the automatic transactional locks mode) on the "Advanced" tab of the query designer allows you to:

  1. Lock the data of the specified source tables for modification when executing a query (outside of a transaction)
  2. Block for reading the data of the specified source tables in the query (both outside and within the transaction)
  3. Lock the data of the specified source tables for reading (within a transaction)
  4. Answers 1 and 2 are correct

The third answer is correct. The lock is released when the running transaction completes.

Question 07.24 of exam 1C: Professional on the platform. When the "To change" flag is set (in the automatic transactional locks mode) on the "Advanced" tab of the query designer, locks occur:

  1. At the database table level
  2. At the record level of the database tables
  3. In the file server option - at the level of database tables
  4. In the client-server version - at the level of database table records
  5. Answers 3 and 4 are correct

The correct answer is the fifth.
Learn more about automatic and managed transactional locks.

Question 07.25 of exam 1C: Professional on the platform. When the "To change" flag is set (in the automatic transactional locks mode) on the "Advanced" tab of the query designer, the following data will be blocked:

  1. All source tables in the query
  2. Only virtual source tables in a query
  3. If the "Tables to modify" list is empty, then all tables involved in the query, otherwise - only tables specified in the list

The correct answer is the third, analysis in the post.

Question 07.47 of exam 1C: Professional on the platform. When you try to execute a query with the text "Select * From Directory.Nomenclature", if read restrictions (in the corresponding role) have been defined on the directory records, the following will happen:

  1. All data will be received
  2. Only data from allowed records will be retrieved
  3. An error will occur

The third answer is correct. To avoid the situation, you need to set the "Allowed" option.

So, let's begin. For clarity, I'll create a form prop with.

Let's place the new props on the form. This can be done in two ways.

The first way: just drag the required attribute with the mouse to the elements tab.

The second way: add a new form element of the Field type and associate it with the required one using the element property Data Path.

I will drag a props with the Boolean type, and it will automatically be set to the view Checkbox field.

The flag itself is not interesting to us. Much more interesting is the property Flag type, which can take three values ​​- Auto, Checkbox and Toggle switch.

If we set this property to the value Toggle switch, then our form will take more beautiful view.

Of course, when the names True and False are written in the switches of the toggle switch, it is not very beautiful. Let's change them to more familiar ones. To do this, we will use the element property Editing format where on the bookmark Boolean we will set the names of the toggle switch buttons more suitable for us.

After that, our toggle switch will take on a more beautiful look. If we want to remove or move the position of the title, then for this we need the element property Position Title... Which takes on many different values, including the value - No.

For more details on how to work with form elements using practical examples, see the book “Development Basics in 1C: Taxi. Developing a Managed Application in 12 Steps ”.

Sometimes it seems that learning a programming language in 1C is difficult and difficult. In fact, programming in 1C is easy. My books will help you quickly and easily master programming in 1C: and "Fundamentals of development in 1C: Taxi"

Learn programming in 1C using my book "Program in 1C in 11 steps"

  1. No complicated technical terms.
  2. Over 700 pages of practical material.
  3. Each task is accompanied by a picture (screenshot).
  4. Collection of tasks for homework.
  5. The book is written in clear and simple language - for a beginner.

This book is suitable for those who have already started programming and are experiencing certain difficulties with this topic and for those who have been programming for a long time, but have never worked with managed forms 1C

  1. No complicated technical terms;
  2. Over 600 pages of practical material;
  3. Each example is accompanied by a picture (screenshot);
  4. The book is sent by email to PDF format... Can be opened on any device!

Promo code for a 15% discount - 48PVXHeYu


If this lesson helped you to solve any problem, you liked it or turned out to be useful, then you can support my project by transferring any amount:

you can pay manually:

Yandex.Money - 410012882996301
Web Money - R955262494655

Join my groups.