Menu
Is free
registration
home  /  Firmware/ 1s make the form element required. Saving settings for dynamic lists

1c make a form element required. Saving settings for dynamic lists

1. Input field
2. Checkbox
3. Switch

Entry field

As a rule, an input field is associated with an object attribute and reflects its data. This is perhaps one of the most common elements, it has several ways to select a value:

List Select (ListSelect Mode)

Selecting from another form (Select button)

Regulation buttons

The implementation of the above examples does not require significant effort on the part of the developer so. for example, for the list mode, you need to fill the list of an element with values; to select from another form, you just need to bind the control with the data of the dictionary. But for the control buttons, you will need to write more code to handle pressing on each button, although it will not be large:

Pv procedure nomenclature selection control (element, direction, standard processing)
// Select data for the input field
// in this case the Nomenclature reference
Request = New Request;
Request.Text =
"SELECT
| Nomenclature.Reference As Item
| FROM
| Reference.Nomenclature AS Nomenclature
| ORDER BY
| Nomenclature.Code ";
TKNomenclature = Request.Run (). Unload ();

// search for the current element of the directory specified in the input field
TekElement = TZNomenclature.Find (Element.value);

If TekElement = Undefined Then
// if the element was not found then set the index number
// outside the table of values, because the very first element in
// value table has index 0
TekIndex = -1;
Otherwise
// if an element is found, get its index
TekIndex = TZNomenclature.Index (TekElement);
EndIf;

// calculate the new index depending on the button click
// minus in front of the variable Direction stands so that when
// clicking on the top arrow showed the element above
// and therefore with a lower index
NewIndex = TekIndex-Direction;

// get the number of elements in the directory
// subtract one since all collections in 8.1 start at 0
Number of Elements = TZNomenclature. Number () - 1;

If NovIndex< 0 Или НовИндекс >Number of Elements Then
// if the index is outside the value table when changing
// i.e. its number is greater than the largest index or less than 0 then
// do not change the value and inform the user about it
Report ("You have reached the limit of the directory");
Otherwise
// assign a new value, "Product" is the name of the column of the table of values
Element.Value = TKNomenclature.Get (NewIndex) .Product;
EndIf;

End of Procedure

Checkbox

In most programs, the checkbox is used to display two states: checked, unchecked. In 1c, the checkbox has three states, in the third state, the checkbox is displayed - as set and at the same time shaded. The three states are available only if the checkbox data is a number, with the states having the following meanings:

Switch

The switch is used to select one value from a small number of possible ones (preferably no more than five), while the values ​​cannot be combined, For example: suitable for selecting the gender of a person. Another example: let's say a company gives one of 3 discounts on a product, while discounts are not summed up:

In this case, the convenience of using the switches may lie in the fact that each of them can have some value, which is set in the "Selectable value" property. And then "5% Discount" can store the value 5 or 0.05.

There are three things to keep in mind when using radio buttons:

      The first radio button should have the property "FirstInGroup" (in this example it is the "5% discount" radio button).

      Switches that are within the meaning of the same group should go one after another in the setting of the traversal order, without interruption by other form elements. The traversal order is set from the "Form -> Traversal Order Setting" menu, for this example it looks like this:

  1. The type of the selected value is set at the radio button having the "FirstInGroup" property.

Input mechanism based on is one of the platform application mechanisms. It allows you to simplify the user's work with the application solution and save him from re-entering data that is already stored in the infobase.

Let's take a look at a simple example. Let's say there is a document in the applied solution Goods receipt, which records the fact that some items of the nomenclature appear in the organization:

After the item is received from the supplier, you should draw up a document Payment for goods and services, in which to indicate the supplier and the amount that he needs to transfer for the delivered goods:

In such a situation, the input mechanism on the basis allows you to generate a document Payment for goods and services automatically using the information stored in the document Goods receipt... This is done literally with one click of the mouse:

After executing this command, the system will create a new document Payment for goods and services and fills in his details according to the information available in the receipt. The user will only have to select specific current accounts, if the supplier and our organization have several of them.

Thus, the input mechanism on the basis allows you to create new objects of the applied solution (reference books, documents, etc.) based on the information contained in other existing objects of the applied solution.

Who are the Counterparties? These are legal entities or individuals who are your customers, buyers or partners. Each legal entity has details, that is, unique data (TIN, KPP, legal and actual addresses) that belong only to this organization. It is with these data that you will need to fill out the counterparty card in the program.

Let's get started. We find the inscription "Reference books" on the left in the menu, click. Before us are the sections of the program, we are looking for "Purchases and sales", subsection "Contractors":

We go to the section. To make it easier to navigate in the process of work, we will create folders by type: "Buyers", "Suppliers" and "Other".

Click on the inscription "Create a group". In the drop-down window in the "Name" field, enter the name of the "Buyers" group:

Create the rest of the Suppliers and Other folders in the same way:

Let's create one item in each folder. Let's start with Buyers. We go in, select "Create":

The page for filling is opened. This is a counterparty card. The upper field, marked in yellow, is designed to automatically fill in information on the counterparty by entering the TIN. This will only work when the 1C Counterparty function is enabled.

We'll look at manual filling. Let's say our customer is the STYLE LLC organization. In the field "Type of counterparty" we leave the Legal entity. In the "Name" field, enter the name of the organization. For the convenience of searching, STYLE LLC is usually entered, i.e. first the name, and then the organizational and legal form. You can just leave one name. The field "Full name" must contain the correct spelling of the name of this organization - LLC STYLE or with the decoding - Limited Liability Company. This will be displayed when printing documents. The field "Included in the group" is filled in automatically. Further, the fields: INN, KPP, PSRN are filled in with the provided details of this organization. A very important point in the "Main bank account" card. Click the little button on the left. Two mandatory fields have opened before us:

In the first field, you must enter the BIK of the bank in which the organization is serviced. In the second field, enter the number of the current account. Further, the item "Address and telephone". Let's expand it:

The legal and actual addresses are filled in here. We see a notification in which we are offered to load the Address classifier. This works only when the 1C Contractors function is enabled. Let's skip. We press the inscription "Fill in" to the right of the legal address. A window opens in front of us for entering the necessary data. Fill in and click OK:

The line "Actual address" will be filled in automatically. If the organization has a different legal and actual address, then it is necessary to uncheck the corresponding box next to the inscription "Actual address coincides with the legal address" and fill in manually. Write down. The same is with the "Postal address" field. In the item "Additional information" you can write any comment. Check if everything is filled in and click "Save" at the top.

All operations in the 1C system are performed using contracts. The contract is a universal accounting separator, which is indicated in almost all documents. Go to the "Agreements" tab and click the "Create" button.

The page "Agreement (creation)" has opened in front of us:

Let's start filling. The first field is "Type of contract". Since we fill out the card of the organization that will buy something from us, we need to select the appropriate type - "With a buyer". If you initially specify the wrong view, then it will be problematic to change. The next field "Contract number" speaks for itself - enter the contract number. On the right, select the date on which the contract was concluded. The "Name" field is generated automatically based on the entered data. If necessary, you can correct and prescribe, as it will be convenient and understandable for us. Next, let's expand and consider the following tabs. "Calculations". Here we choose in what currency settlements with our buyer will take place. In the "VAT" field, you must select the procedure for registering invoices specifically for this agreement.

If our buyer (organization) has provided information about managers, then you can fill in the fields in the "Signatures" section. This will be displayed when printing documents. If this data is not available, then skip. In the "Additional Information" section, the term of the contract is entered, if it is indicated. You can leave the field blank. And you can select "Type of settlement". We are finished with this agreement. Click "Save and Close". Now we can see that our counterparty STYLE has a contract “With the buyer”. Pay attention to the "Use as main" function. If we mark it, then this type of contract will be put in the documents by default:

In addition to the agreement, there is a very important tab "Bank accounts":

Here we see the account that we have already created, which was indicated on the main tab. And, as in the contract, we can mark the "Use as main" function to use this account by default.

Let's say there is a counterparty who has two contracts: "With the supplier" and "With the buyer". One is used more often, it is this contract, we can mark the main one to simplify the input of information.

In the "Contact persons" tab on the main page, the data of the person from the counterparty are registered, to whom we can contact, if necessary. This can be a director, accountant or manager:

Here, on the "Addresses" tab, we can indicate his phone numbers and e-mail address for communication. After entering, click "Save and Close":

We return to the page with a new contractor. If we click the "More" link, "Accounts for settlement with a counterparty" will be available:

This is a similar directory "Item Accounting Accounts", only for a business partner. Here 60 and 62 accounts are usually used.

The entry of the buyer is now complete.

In the same way, we will create a supplier - Edelweiss LLC. Return to the Suppliers folder and click Create. The whole process of filling in with data is the same as for the Buyer. Only the type of contract will be indicated "With supplier":

Also, in the "Agreements" and "Bank accounts" tabs, mark the "Use as main" setting. Dealt with the supplier.

Let's now go back to the "Miscellaneous" folder. Banks, tax services, etc. are set up here. Let's set up a bank here in the same way to display the receipt of bank commissions:

For such counterparties, the type of contract must be used "Other":

Thus, the counterparty is entered into the information base, the contract is assigned to it, and this data will be automatically used in mutual settlements with this counterparty.

We continue the topic of common mistakes that users of the 1C Accounting program make. In this and this article, I have already told you about common mistakes. Now we will focus on errors that arise due to user carelessness.

Very often, many 1C users simply skip fields in documents, not paying attention to them. As a result, the document is not posted at all or posted, but incorrectly. First, let's see if it is possible to skip (not fill in) fields in documents at all.

When you can leave the details of 1C Accounting documents empty

At first glance, it may seem that if the document contains some kind of requisite (field, checkmark, and so on), then it must be filled in. After all, it is located on the form for a reason, right? However, in fact, there are cases when it is really possible to leave some of the fields blank in the document, and this will not affect the result. Take a look at the picture.

site_

Third reason. Elementary carelessness. When working in 1C Accounting, and indeed in any accounting program, you should be a little more careful than usual. And do not miss the details of the documents.

Let's sum up

When working in 1C Accounting, do not skip the fields! This applies not only to empty fields, but also filled with some default values, which are not always correct. I also remind you that there can be many tabs in a document. It is recommended to fill out all 1C documents

The form is controlled by means of various form elements, which are arranged hierarchically on the tab The elements form constructor. The most important element is the form itself, which is located at the top of the hierarchy of elements, and the rest of the elements are subordinate to it.

All form elements can be divided into five groups: fields, grouping elements, buttons, decorations, and tables. In my articles, I will analyze each of the groups. In this article, we will start to explore one of the types of field element - entry field, but before that, let's learn how to add an element to the form.

Adding elements to the form

This is done quite simply: you need to select the element The form in the Elements of the form designer and click on the "Add" button. After that, a window will open in which you need to select the desired type of element

After selection, the item you want will appear in the window The elements.

Managed form element Field

Parse a managed form element Field... This element is needed to enter information on the form. And also to display any information. After you add this element to the form, a palette of form element properties will open on the right. For now, you should be interested in two properties - Data Path and View.

In theDataPath property, the developer can associate a form element with the required form attribute. Please note that after the item has been added Entry field on the form, it did not appear on the form itself. This happened because our new item is not associated with. As an example, I created on the processing form several attributes with different primitive types and one attribute with a reference type.

Now we will link our newly added form element with one of the attributes, for this we will select the required attribute with the property of the Data Path element.

After that, the Data Path and View properties will be filled, and the element itself will be displayed in the form view.

Notice the property of the element View... This property defines the functionality of the input field. You can choose different values ​​for this property.

Depending on the selected value, the functionality will be determined. In the pictures above, the value is selected - entry field, i.e. we can enter any values ​​in this input field, and if we select a value lettering field, then we will not be able to enter anything.

This property value View input fields are convenient to choose when you just need to show help information to the user.

Now let's add a new form element with the type Entry field and link it to the props RequisiteDate by means of the already familiar property PathKData

As you can see, the view of the input field has changed, as well as the possible choice of values ​​for the View property.

Thus, we conclude that the functionality of the input field depends on the type of props.

For props with type Boolean the following values ​​of the View property will be available.

And for an attribute with a reference type, other values ​​of the View property will be available.

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 1C managed forms.

  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 e-mail in 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.